本文整理汇总了C#中JigLibX.Physics.Body.AddConstraint方法的典型用法代码示例。如果您正苦于以下问题:C# Body.AddConstraint方法的具体用法?C# Body.AddConstraint怎么用?C# Body.AddConstraint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JigLibX.Physics.Body
的用法示例。
在下文中一共展示了Body.AddConstraint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialise
public void Initialise(Body body0, Vector3 body0Pos, Body body1, Vector3 body1Pos, float allowedDistance, float timescale)
{
this.body0Pos = body0Pos;
this.body1Pos = body1Pos;
this.body0 = body0;
this.body1 = body1;
this.allowedDistance = allowedDistance;
this.timescale = timescale;
if (timescale < JiggleMath.Epsilon)
timescale = JiggleMath.Epsilon;
if (body0 != null) body0.AddConstraint(this);
if (body1 != null) body1.AddConstraint(this);
}
示例2: Initialise
public void Initialise(Body body, ReferenceFrame frame, Vector3? vel, Vector3? angVel)
{
this.body = body;
this.frame = frame;
this.doVel = (vel != null);
this.doAngVel = (angVel != null);
if (doVel) targetVel = (Vector3)vel;
if (doAngVel) targetAngVel = (Vector3)angVel;
if (body != null)
{
vel = body.Velocity;
angVel = body.AngularVelocity;
}
else
{
vel = Vector3.Zero;
angVel = Vector3.Zero;
}
velRate = Vector3.Zero;
angVelRate = Vector3.Zero;
if (body != null)
body.AddConstraint(this);
}
示例3: Initialise
public void Initialise(Body body, Vector3 pointOnBody, Vector3 worldPosition)
{
this.body = body;
this.pointOnBody = pointOnBody;
this.worldPosition = worldPosition;
if (body!=null) body.AddConstraint(this);
}