Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Very simple kart physics

Author
Message
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 13th Dec 2018 02:05
I get no tunnelling with that version so far so good
fubar
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 13th Dec 2018 02:50


Using Virtual Nomad's Height map from Friday 4x (Hope that's Ok matey)

Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 13th Dec 2018 21:45 Edited at: 13th Dec 2018 21:57
Just gave it a spin.

Found that sometimes gets stuck still on the transition of a slope to a straight level, especially when the car is not entirely level.
Noticeable when for instance driving slowly up the large ramp and then trying to get onto the wall. Then the car's angle is slightly off and appears piece of the car is in the geometry causing it to wobble or get stuck.
Reset most of the time fixes it.

Once got stuck with the hood in that particular wall while jumping across the track. Then reset doesn't work unless pressed multiple times to get complete reset to start.

Upside down still takes the car's top through the floor(as well as the cam), but haven't experienced completely falling through the floor this time.


Still good fun though.
Can't believe AppGameKit didn't; implement vehicle physics by default yet as its so much fun to stunt drive round like this. AppGameKit team should really try it out to get the feel and gain enthusiasm.

[EDIT: just seen the vid. Looking good!]
.
puzzler2018
User Banned
Posted: 13th Dec 2018 21:58
Vehicle / steering physics is a whole new venture to what AppGameKit started out with. i suppose Paul doesnt have time to implement it generally

A continuation of good work and knowledge building to use earthlings
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 14th Dec 2018 00:04
@Puzzler2018
Quote: "
Vehicle / steering physics is a whole new venture to what AppGameKit started out with. i suppose Paul doesnt have time to implement it generally"


Might very well be, as Paul seems to be handling lot's of stuff already and does a heck of a job.

I can understand a company like TGC has limited resources and they appear to be using a lot of resources for GameGuru also, in order to make a buck.
So perhaps emphasis is less on AppGameKit, but I think it would draw a lot of positive attention if they could pull this rabbit out of the hat, as it adds a lot of versatility to the language and opens up a lot of interesting possibilities for people to get excited about.

Might be that isn't so easy to integrate into the existing structure though, which is probably quite complex already given the multiplatform capabilities.
Perhaps requires lots of intricate knowledge also to do it properly and make everything coherent.


Keeping fingers crossed that they do still though.

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Dec 2018 01:37 Edited at: 14th Dec 2018 01:41
Quote: "Found that sometimes gets stuck still on the transition of a slope to a straight level, especially when the car is not entirely level."

Yes this will happen because the car is just a basic block and everything hangs off it. Still trying to find a ways around that. Tried compound shapes with no luck

Quote: "Upside down still takes the car's top through the floor(as well as the cam), but haven't experienced completely falling through the floor this time."

Same thing. If i try to make the block larger it all goes to pot

Anyway. You can see for yourself, I added the source code to the first post. I'll add the height map one after i've tidied it up a bit
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 14th Dec 2018 02:09 Edited at: 14th Dec 2018 02:11
I think blink has done quite well with the tools he had and has created a great arcade style physics

ive had a bit of a play with the source and for those that want to play around more

in main.agc change the following in the MoveVehicle function for understeer increasing the 250 gives
a greater steering ability but too high a value dont seem to effect it at low speeds only at high speeds
due to the way it uses the physics commands for movement. There is also a nitrous addition for those
that like to live dangerously lol



Quote: "If you have other changes im sure blink and the rest of us would like to see shared here"
fubar
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Dec 2018 02:42
Look good fubes! I attached the Height mapped source code as well.
When running it there's a little delay at the start which is AppGameKit making the height map (because my height map is too big)
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 14th Dec 2018 04:20 Edited at: 23rd Dec 2018 09:44
On that attempt I stuffed the loop de loop at the bottom but im sure you can see that it works
Video removed for space please see latest post
PS it is at present different than the current source but I wanted to show off just how good the
physics works. As the current uploaded media don't include the loop de loop
fubar
Virtual Nomad
Moderator
18
Years of Service
Recently Online
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 14th Dec 2018 05:23
Quote: "loop de loop"

rats. you beat me to it
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Dec 2018 05:38
fubarpk knievel
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 14th Dec 2018 05:51
bahahaha
but you still can and much much more blinks code works quite well
and you could even do you own stuntcar racer track even which was my plan
like stuntcar on amiga/Atari just designing the low poly track with banked
turns etc I haven't been able to find the suitable tracks for purchase nor
have I been able to rip them out of the amiga emulator or dos version thinking
that wouldn't be so bad as there copyright nolonger holds and could retexture
them aswell but no luck and if I was to design them which I also tried when I did
the banked turns they were too high polly and my models I don't know how to
texture map

but for those that haven't played stuntcar racer before and would like to try an online
version https://classicreload.com/c64-stunt-car-racer.html
fubar
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 14th Dec 2018 21:38
@blink0k
Quote: "Anyway. You can see for yourself, I added the source code to the first post. I'll add the height map one after i've tidied it up a bit"

Pretty cool!

@fubarpk
Like the way it handles, but something tells me this thing needs a handbrake so it can drift. XD


Also I didn't get stuck yet, Only upside down.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Dec 2018 21:55 Edited at: 14th Dec 2018 22:55
Fixes
1. Added compound shapes and it appears to work better, less catching on the edges of hills. So now the hit shape is a box plus 4 spheres for the wheels
2. I shouldn't sink into the ground when it flips now. The camera will but that's just my poor camera controls
3. Slides off hills (See bugs1.)
4. Added a version number 1.0
5. Ground.3ds with loop de loop (Much harder than fubarpk's) Tip: Enter at the inside edge

Bugs
1. When you stop moving it tends to drift. This is a problem with balancing. I wanted it to slide off hills if you stopped on them, which works, but has caused the drift problem
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 14th Dec 2018 23:16 Edited at: 14th Dec 2018 23:17
Good fixes.
But still got stuck in the wall sometimes...


Ramp is a great addition but got me stuck couple of times on de edges.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Dec 2018 23:31 Edited at: 14th Dec 2018 23:38
Ok. I'll have a look

Is that happening when you hit R-Reset?

Did you make any changes to the code?
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 14th Dec 2018 23:39
Nope. Need to hit R multiple times to break free(reset to center). Must admit I've been driving like a celeb under the influence of alcohol and drugs(e.a.w madman).
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Dec 2018 23:42 Edited at: 14th Dec 2018 23:45
Ok. Thanks heaps Rick! Can you make it happen regularly?
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 14th Dec 2018 23:47
Your welcome. Happened during turning and jumping a lot.
It's too addictive btw. Need to go get some sleep.
Ltrz..
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 14th Dec 2018 23:57
I got stuck in the ramp in the past a couple of times and found I had to hit reset twice to fix it
I was thinking maybe need to reset to centre but that would kinda be just as big a pain,
And with the nitrous addition above it happened more often and I rolled so many times
hahhahah glad it wasn't a real car but I do love it.

Whats sleep Rick Nasher?
fubar
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 15th Dec 2018 01:01
I can understand if it tunnels when you set the speed high but i cannot make it tunnel in the environment for the life of me (Forget about the loop, the environment in general)

If you want the reset to fully reset then just change SetupVehiclePhysics(vehicle, FALSE) to SetupVehiclePhysics(vehicle, TRUE)
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 15th Dec 2018 12:45
@fubarpk
Quote: " Whats sleep Rick Nasher?"




I used to think like that, think of it as a waste of time, I mean:
A day has 24hrs, - sleep 8hrs =16hr. - work 8hrs= 8hrs. - traveling 2hrs. - eating & preparing 2hrs, - showering, etc. What's left is probably 2, max 4hrs a day of real time?? So I had a pattern being up till like 4:30, skip a night or so. Went ok for years. Then, also due to work pressure I must say, the man with the hammer came and hit me bad.

Now if I do not sleep (which is a big challenge for me) and divide my energy, I'm getting terrible headaches, dizziness, can't stand loud noises/light, can't concentrate, weird pains etc.
I do not wanna end up like Ploppy (if anybody from Blitz remembers him), so have no choice.

But remains a challenge..
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 15th Dec 2018 13:39 Edited at: 15th Dec 2018 13:42
@blink0k

Still got it:


Happened in 2mins time, however on the positive side: couldn't get this to happen with the heightmap version.
Don't see why though. Possible that there are more triangles in there so can't slip through?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 15th Dec 2018 21:25
Is that coming off that big ramp?
Try reducing maximum velocity to 1600. Don't drive like a maniac either!
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 15th Dec 2018 22:07
Quote: "Don't drive like a maniac either! "

huahhahaha wheres the fun in that. (sorry couldnt help myself but that humor gave me a good laugh this morning)

Quote: "Is that coming off that big ramp?"

It looks to me like its the bumpy section that has two sides
fubar
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 15th Dec 2018 22:46
Do you get that sort of tunneling at speeds below 1800?
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 15th Dec 2018 23:37
I dont it was only when I increased it I had a problem and it wasn't that often
but I may not be doing the same thing as Rick Nasher and if the height map method
fixes the problem for Rick perhaps that it is the better method and users could add
there own ramps etc to the terrain that way.
fubar
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 16th Dec 2018 00:34
Quote: "Is that coming off that big ramp?"


Yep. Happened in the ramp area.
Quote: "
Quote: "Don't drive like a maniac either! "

huahhahaha wheres the fun in that. (sorry couldnt help myself but that humor gave me a good laugh this morning)"

Indeed! Maybe it's because I don't have a license..

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 16th Dec 2018 00:36
Unless i'm falling from a great height i cannot make it happen. I really gotta work hard trying to get a jump on that ramp to make it happen.
Would it be possible to get some video of it happening?
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 16th Dec 2018 12:17
That's what I was thinking but appears to be quite random, can't figure out exactly when. Will see if have time this afternoon/evening. Boring stuff to do like, x-mas shopping, putting up tree(all to please gf, for I do not really care much lol).
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 17th Dec 2018 00:30
So I couldn't make head nor tail of the bullet physics, so decided to just build my own. It's eary days, but here we see some basic physics for a car. Video shows me creating a random terrain, then generating the car and driving around it.

So far it accounts for:
*Downward force (per wheel)
*Forward force
*Roll
*Tilt

So all the calculations here are done based on actual positions in the world, with no normal calculations taken into account.

Needs smoothing (to get rid of that bumping), better control of terrain adjustments for angles, some form of dampening on the bounce (you may notice when I jump it REALLY bounces when it hits the ground again at speed, more than I want it to), and occasionally you fall through the world (though oddly only at really slow speeds?!?).

Again, zero bullet physics involved - total code is about 60 lines start to finish.

Not up there with Blinks bullet physics work yet, but I will be curious to see which way can be better refined.

AGK - FOR THE LOVE OF ALL THINGS GOOD ADD THE PHYSICS DEBUGGING! Lol.

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Dec 2018 01:35 Edited at: 17th Dec 2018 01:46
Very cool santo dude. Are you using ray casting for collision?
Could you tell me what the min/max values for that mesh are?
Did you scale the vehicle from my demo at all?
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 17th Dec 2018 01:49 Edited at: 17th Dec 2018 01:51
Yeah, just basic raycasting. Essentially I have a small cube (You can see it next to the rear right wheel) - it's placed on each wheel then a ray is cast down. From this I collect height and collision data, then do some simple maths to shift the "car" about.

I suppose one advantage is it's locked to engine speed and frame rate (shouldn't) affect the stability. Well, as long as the rays hold out.

Can't roll or tumble yet though.

The mesh is huge, so the min max on that is about 2,000,000 height wise. It doesn't use anything from you demo, it's just a cube and four cylinders, and the cube itself has no collision detection. Does mean it can clip on angles though.

Once it's polished up a bit ill share the code.
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 17th Dec 2018 05:19
Ok, so I've been at it a few hours and I polished it up a fair amount - there's not so much as the slightest ability to drop through the ground anymore, there's far better mapping to the terrain, and it has improved aerodynamics and now streering based on speed and inertia (it even power slides).

In this video I drive a little on a flat, then load a simple world with some hills, before taking it for a full test drive across about two thirds of teh world builder test level. Note at the end it drives over the bridge too.

There's still a judder that I haven't figured out yet, and it needs to have speed impacted by slopes so it can't climb any hill, but other than that I think it's essentially functional enough for a simple game. However the code can be adapted to place ANY object aligned to the ground now, all it needs is the four "wheels" to be in place (the four invisible cylinders placed where the models wheels are that do all the work).

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Dec 2018 06:48
Looks superb santman. I have been told that the 3dPhysicsRayCast functions are more accurate than the regular RayCast functions and may stop the jitter.
It really does look great though. Superb work!
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 17th Dec 2018 08:18
Thanks blink, but I don't think it compares to your stuff, and there's probably a much better way.

I may try physicsrays at some point.
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 18th Dec 2018 11:27
So I've been thinking about the stunt car racer comments, and how you could easy build a track? Importing models and texturing them is no problem, but is there a better way?

My thought was this - a simple cube built, but with the right hand face missing. You then add more and more faces to essential "lay" a road, which would be one memblock mesh.

Or, it could be done with boxes, then simple use memblocks to adjust the vertices in them to join up. This had a pro and a con: AppGameKit builds efficient boxes easily, but youd you'd have two faces per section you didn't need.

Or, the method I think is best, build a box and uv map it, make a memblock, then use that with method two.

What you guys think?
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 18th Dec 2018 11:34
In terms of my non bullet physics car, I'm struggling with the bouncing. The issue is it balances each wheel, then measures which ones are on the ground. If any wheel is above the ground, it attempts to adjust the car to match, but this means it goes rotates the vehicle slightly, which may raise another wheel. This then results in it fighting with itself on anything other than a flat surface.

So i had two thoughts: suspension. A small, variable movement in each wheel that would account for small variances in the ground, to stop the whole vehicle adjusting. It would also potentially look awesome. Lol.

Second thought, can we change the pivot point? I think the pivot always seems to be based on 0,0,0 using fix object pivot. So in my head if I place the front wheel axle over 0,0,0 then fix the pivot, rotating it should then work based on the front axle.....I.e. only the back wheels would raise. In practice I can't get this to work. Has anyone else managed something like this?
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 18th Dec 2018 17:53
Quote: "So I've been thinking about the stunt car racer comments, and how you could easy build a track? Importing models and texturing them is no problem, but is there a better way?"

I looked for the models everywhere and even thought i could retrieve them from the original. I appears to me to be easier to get models from WOW. I think my main issue is the software that
looks like doing so wont work on later computers and there is many versions available online including JAVA ones. I tried making my own which i can do the problem was making the banked
/sloped corners low poly, my methods of creating banked corners is too high poly.

@Santman from my understandings blink opted for quite a complex routine in the beginning that checked alsorts and tried to mimick the behaviour of the car and he went back to a system
that made use of the AGKS built in commands more so with some differences. Thats my understandings of what has happened with the code Its all a learning curve but then i may have missed
something important (wouldnt be first time lol)

Im sure whatever is achieved on this thread will be greatly appreciated by most AppGameKit users and could become a valuable asset for the TGC community
fubar
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 18th Dec 2018 19:04 Edited at: 18th Dec 2018 19:10
Quote: "So i had two thoughts: suspension. A small, variable movement in each wheel that would account for small variances in the ground, to stop the whole vehicle adjusting. It would also potentially look awesome. Lol."

This is what i did. It does look great. Have a look at the video below from about 1:30

Quote: "a system that made use of the AGKS built in commands"

Yes. All i do is apply forces and the rest is AppGameKit Physics

Quote: "Really awesome stuff Blink. I just now seen all of this. Looking forward to giving it a try tonight!"

Thanks GB. Really looking forward to seeing your results

Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 18th Dec 2018 23:11
You did that video? Why did you ray cast from the vehicle corners and not the bottom apex of the wheels?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 18th Dec 2018 23:40 Edited at: 19th Dec 2018 00:49
Quote: "You did that video?"

Hell no! It did give me the idea to do the ray casting though.

Quote: "Why did you ray cast from the vehicle corners and not the bottom apex of the wheels?"

The model of the vehicle would sit on top of that box and i would say those corners line up with the vehicle wheels
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 19th Dec 2018 00:23
Ah, I was about to ask why you were using AGK. Lol.

It does look good, but a physics engine is just maths really, with a lot of ray casting. I'll see how it goes with mine, the suspension is kind of half working, and it's getting there, but it developed an odd bug that occasionally gives the player a flying car on a big jump.

I wonder.....I have four spheres tagged to the bottom of the wheels, they handle impact and inertia etc....but to make something more, such as the ability to roll, could you get the angle of the car and then work out which side is pointing down, then position the points at fixed distances on that side? That way it could detect impact downward on any angle. Or maybe raycasting on alternate frames for other impacts?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Dec 2018 01:01 Edited at: 19th Dec 2018 03:02
I think in the end you'll need to cast from all angles at all corners


You could halve the number of casts by joining top+bottom left+right back+front


Maybe you could use that SphereCast function from each corner

Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 19th Dec 2018 02:44 Edited at: 23rd Dec 2018 09:44
nothing like blinks cute Kart but I decided a jeep was called for and
designed this. Its very low poly
Video removed for space please see latest post
No Wheels yet and ive been playing with it with one of blinks projects
Its the same size of blinks kart but i tried using his wheel positioning
and the jeep needs them more toward front and back. So when i
figure how that part of his code positions il have a working SUV might
use it with the height map verson

The model can be found here for anyone interested
http://users.tpg.com.au/subarpk/jeep.rar


Admittedly im very much a beginner but the texture mapping has put
me off in the past. But that texture was unwrapped with lithunwrap
fubar
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Dec 2018 03:01
That looks fantastic matey! Very nice work. If it's ok i'd like to use it

There is a function MakeCar.agc called MakeCarFromModel().

The car should face down the z-axis

The car should be around the same size as the example model in the suv folder

If you name your car shapes;
// hit=The hitbox (Roughly the shape of the car above the wheels)
// chassis=The body of the car
// fr, fl, rr, rl=Wheels
// camera=Any shape, usually behind and slightly above the car

Then MakeCarFromModel() will generate .obj files from your model than can be loaded by LoadVehicle()

Note that the .obj files will be located in C:\Users\your_id\AppData\Local\AGKApps\kartphysics\media

Good luck with it!
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 19th Dec 2018 03:10
Thanks Blink your welcome to it

Ok il try the makeCarFromModel() function and see how I go thanks
fubar
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 19th Dec 2018 03:28
Just tried it out. This is a very cool project.

The vehicle really zips around fast. Jumping is awesome. I drove around and jumping until finally the car came down from a jump and got stuck in the floor.

It's really quite awesome Blink. Just need to sort out getting stuck in the ground which I'd guess is simply casting a ray out further down to check for the floor. Generally that is what causes these kinds of problems. People use a fixed length cast and when the object's velocity is greater than the length of the ray the cast reports no collision and object ends up inside another. I'd make the ray length based on the speed of the vehicle. Maybe you are already doing that I didn't look at the code just loaded the project and ran it. If you are already casting based on velocity then maybe restructure the code to be sure you are casting before the object is actually moved.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Dec 2018 05:40 Edited at: 19th Dec 2018 05:40
Thanks GB,
Would love to see what you can do with it

Quote: " I drove around and jumping until finally the car came down from a jump and got stuck in the floor."

It think this is just a limitation of the physics system. You are traveling at such a high velocity going over the jump it tunnels. I think it can be managed by good design.

Quote: "simply casting a ray out further down to check for the floor"

The only reason i use the ray casting is to see if the car is touching the ground (And manage the suspension eye candy)
All i do is add linear and angular forces to make the car go forward and turn. When the car is in the air i do nothing. I will give your idea some thought though because obviously the transition from flying to moving on the ground is an issue.

My philosophy on this is to stay out of the way of the physics system as much as possible.

I have done a bit of work on this since i last added the source code so i'll update the first post

Login to post a reply

Server time is: 2024-04-26 09:08:18
Your offset time is: 2024-04-26 09:08:18