A Unit-to-unit collision: request

A Unit-to-unit collision: request

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
msafwan
Posts: 38
Joined: 16 Dec 2010, 14:44

A Unit-to-unit collision: request

Post by msafwan »

Hi, could I request for a tiny change on Spring's unit-to-unit collision behaviour? It would be nice if momentum conservation can reinstated again.

I have tested it, and the changes was not much work. In "GroundMoveType.cpp" I commented line 924 & 926 and it restores momentum conservation:

Code: Select all

923			collider->speed += colliderImpactImpulse;
924			//collider->speed *= 0.9f;
925			collidee->speed -= collideeImpactImpulse;
926			//collidee->speed *= 0.9f;
The reason I need it is because; now I could launch unit(s) upward using impulses without them stopping abruptly (at mid air) due to unit collision. This is how they usually jump close together (without this fix they will fall to ground after 1/4 of the jump):
Image

I saw that tanks now can push each other like hovercraft, but I think this is a good feature!; one can create a unit tagg like "friction" to define how much unit resist being push in x-z plane. At line 924 & 926 :)
Post Reply

Return to “Engine”