本文整理汇总了C#中Vector3.ToPhysX方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.ToPhysX方法的具体用法?C# Vector3.ToPhysX怎么用?C# Vector3.ToPhysX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector3
的用法示例。
在下文中一共展示了Vector3.ToPhysX方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetVelocity
public Vector3 GetVelocity(Vector3 position, CoordinateSpace positionSpace = CoordinateSpace.Global, CoordinateSpace velocitySpace = CoordinateSpace.Global)
{
Vector3 result = positionSpace == CoordinateSpace.Global
? _rigidBody.WrappedActor.GetPointVelocity(position.ToPhysX()).ToStandard()
: _rigidBody.WrappedActor.GetLocalPointVelocity(position.ToPhysX()).ToStandard();
return ToCorrectSpace(velocitySpace, result);
}
示例2: UpdatePlane
private void UpdatePlane()
{
Vector3 p = DistanceFromOrigin * _normal;
Vector4 pWith1 = new Vector4(p.X, p.Y, p.Z, 1);
Vector4 pPrimeWiht1 = GMath.mul(pWith1, _pose);
Vector3 pPrime = new Vector3(pPrimeWiht1.X, pPrimeWiht1.Y, pPrimeWiht1.Z);
Vector4 nWith0 = new Vector4(_normal.X, _normal.Y, _normal.Z, 0);
Vector4 nPrimeWith0 = GMath.mul(nWith0, _pose.Transpose.Inverse);
Vector3 nPrime = new Vector3(nPrimeWith0.X, nPrimeWith0.Y, nPrimeWith0.Z);
float d = GMath.dot(pPrime, nPrime);
_wrappedPlaneShape.Normal = nPrime.ToPhysX();
_wrappedPlaneShape.Distance = d;
}
示例3: SetLinearVelocity
public void SetLinearVelocity(Vector3 velocity, CoordinateSpace velocitySpace = CoordinateSpace.Global)
{
if (velocitySpace == CoordinateSpace.Local) velocity = _rigidBody.Pose.ToGlobalDirection(velocity);
_rigidBody.WrappedActor.LinearVelocity = velocity.ToPhysX();
}