Rotation and Force!

Blitz3D Forums/Blitz3D Programming/Rotation and Force!

Tibit(Posted 2004) [#1]
If I have two circular or Box objects that collides and I want them to have a momentus, a spinn force that effekts their collision. How should I do to apply this force. Moment = Force*Length, but how could I check where I hit that object, what I mean is : How to get Length?


ZombieWoof(Posted 2004) [#2]
The collision functions will give you the location of the hit on the target object, the normal of the impact, and some other useful data, and the position of the entity after the collision code runs is availble for precise distance measurement... but anythhing other than a straight bounce (i.e. accounting for elasticity, friction, imparted spin, etc) is gonna drive you insane unless you use a physics library like Tokamak or Newton :)

If you are using force based movement, you should be accumalating momentum in a variable every game loop, by updating the momentum variable whenever a force is applied (i.e. while the player holds down the space bar to accelerate, or friction reducing momentum while not accelerating)

I pulled a little code like that to handle players jumping more realistically... imparting an initial force, reducing vertical momentum via gravity, until the player impacts the ground again. Even included a recovery time before they could jump again.


Tibit(Posted 2004) [#3]
I've just created a set of Vector functions. I use force based movement. The force add up to the final speed of the tank. I so much want moment to work, atleast rotation. This can be used for bullet hits too. Kind cool effekt =) If you get the spinn off ;)

The bad thing is.. I'm programming 2D (but I'm using Blitz3D) I wanted to do my first game in 2D, that's why. So I don't use any transparency effects nor 3d_entity_collision_detection, should I post this in the BlitzPlus forum instead?