object affected by air

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
sazon
Posts: 15
Joined: Thu Jun 23, 2011 6:07 pm

object affected by air

Post by sazon »

hello again, is there any way I can have an object in my space and this is affected by the air force. want is to pass air force as a vector, can it be?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: object affected by air

Post by Norbo »

If you just want to apply wind in the form of a steady force, you could modify the Space.ForceUpdater.Gravity property to include the wind force.

You could also cycle through all entities and apply an impulse to them yourself by using the velocity properties or the ApplyImpulse methods.

If you want to have a wind speed, you could go with the cycle-through-entities approach and compute the velocity in the direction by using a dot product. An entity's linear velocity along a direction is Vector3.Dot(normalizedDirection, entity.LinearVelocity). Compare this to your desired wind speed. Apply a force on the object without accelerating it past your wind speed.
Post Reply