I'm trying to quickly upgrade to 0.15.2 this evening and have everything compiling with a few things commented out. ApplyAngularImpulse is one of the functions I cannot seem to locate. This is a pretty big deal since I was using this function along with ApplyLinearImpulse to control the player controlled object in my game. If ApplyAngularImpulse is gone, what can I do to emulate it?
Thanks.
Where did ApplyAngularImpulse go?
Re: Where did ApplyAngularImpulse go?
ApplyLinearImpulse and ApplyAngularImpulse were redundant with setting AngularMomentum/LinearMomentum.
For example, LinearMomentum += new Vector3(0,5,0) is the same as ApplyLinearImpulse(new Vector3(0,5,0)).
For example, LinearMomentum += new Vector3(0,5,0) is the same as ApplyLinearImpulse(new Vector3(0,5,0)).
Re: Where did ApplyAngularImpulse go?
Okay, make sense.Norbo wrote:ApplyLinearImpulse and ApplyAngularImpulse were redundant with setting AngularMomentum/LinearMomentum.
For example, LinearMomentum += new Vector3(0,5,0) is the same as ApplyLinearImpulse(new Vector3(0,5,0)).
The other question I have regarding the upgrade is:
I noticed that the Entity.Events were moved into Entity.CollisionInformation and that the ContactCreated event parameters changed. Previously, its first two parameters were the Entities that generated the contact. Now, they are Collidables.
I was using the Entity.Tag property to store a reference back to a Type in my engine that owned the Entity. Is there anyway to continue along that same line with Collidable? I don't see any way to get the associated Entity with the second Collidable.
Thanks.
Re: Where did ApplyAngularImpulse go?
The easiest way is to probably use BroadPhaseOverlap's Tag property that the Collidable inherits. You'll have to download the latest development version for that feature: http://bepuphysics.codeplex.com/SourceC ... evelopment
Note that an Entity's Collidable's Tag is separate from the Entity's own Tag.
Note that an Entity's Collidable's Tag is separate from the Entity's own Tag.
Re: Where did ApplyAngularImpulse go?
Okay, got the latest and compiled it. I think I've got all the Tag stuff sorted out. Basically, everything that was previously using Entity.Tag is now using Entity.CollisionInformation.Tag. However, for some reason I'm no longer getting ContactCreated notifications. In fact, I don't think anything at all is colliding.
Re: Where did ApplyAngularImpulse go?
Disregard the above.BrianL wrote:However, for some reason I'm no longer getting ContactCreated notifications. In fact, I don't think anything at all is colliding.
I was calling Space.BroadPhase = new DynamicHierarchy(); After looking at the demos, I see we no longer have to explicitly create and set the broad phase. After making that change, collisions are working again. Will start testing things now to make sure everything else still works.