Where did ApplyAngularImpulse go?

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
BrianL
Posts: 54
Joined: Wed Jun 25, 2008 4:41 pm
Location: Panama City Beach, FL

Where did ApplyAngularImpulse go?

Post by BrianL »

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.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Where did ApplyAngularImpulse go?

Post by Norbo »

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)).
BrianL
Posts: 54
Joined: Wed Jun 25, 2008 4:41 pm
Location: Panama City Beach, FL

Re: Where did ApplyAngularImpulse go?

Post by BrianL »

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)).
Okay, make sense.

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.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Where did ApplyAngularImpulse go?

Post by Norbo »

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.
BrianL
Posts: 54
Joined: Wed Jun 25, 2008 4:41 pm
Location: Panama City Beach, FL

Re: Where did ApplyAngularImpulse go?

Post by BrianL »

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.
BrianL
Posts: 54
Joined: Wed Jun 25, 2008 4:41 pm
Location: Panama City Beach, FL

Re: Where did ApplyAngularImpulse go?

Post by BrianL »

BrianL wrote:However, for some reason I'm no longer getting ContactCreated notifications. In fact, I don't think anything at all is colliding.
Disregard the above.

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.
Post Reply