Friction and drag

Feb 3, 2009 at 6:25 PM
In the FrictionDefault Dependency property you say "Use this to adjust the initial friction value of all geometries. Note that you can still modify individual geometries.".
How can one change the Friction of an object ? it seems it is not feasible since the code that creates each PhysicsSprite is linked to the FrictionDefault:

           PhysicsSprite polygon = new PhysicsSprite(Simulator, _parentCanvas, element, points, DebugMode, (float)FrictionDefault);

Also, how can we change the other physical properties of the bodies like: LinearDragCoefficient, RotationalDragCoefficient, etc ?

Tiago Andrade e Silva
Feb 3, 2009 at 7:01 PM
You need to handle the Initialized event of the PhysicsController. This event fires after all of the physics bodies have been created.

You can then use the PhysicsObject dictionary to access Body Objects like so:

physicsController1.PhysicsObjects["XXXXX"].BodyObject.LinearDragCoefficent = ...;