本文整理汇总了C#中PhysicsActor.SetVolumeDetect方法的典型用法代码示例。如果您正苦于以下问题:C# PhysicsActor.SetVolumeDetect方法的具体用法?C# PhysicsActor.SetVolumeDetect怎么用?C# PhysicsActor.SetVolumeDetect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhysicsActor
的用法示例。
在下文中一共展示了PhysicsActor.SetVolumeDetect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyPhysics
/// <summary>
/// Apply physics to this part.
/// </summary>
/// <param name="rootObjectFlags"></param>
/// <param name="m_physicalPrim"></param>
public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive, bool m_physicalPrim)
{
bool isPhysical = (((rootObjectFlags & (uint) PrimFlags.Physics) != 0) && m_physicalPrim);
bool isPhantom = ((rootObjectFlags & (uint) PrimFlags.Phantom) != 0);
if (IsJoint())
{
DoPhysicsPropertyUpdate(isPhysical, true);
}
else
{
// Special case for VolumeDetection: If VolumeDetection is set, the phantom flag is locally ignored
if (VolumeDetectActive)
isPhantom = false;
// Added clarification.. since A rigid body is an object that you can kick around, etc.
bool RigidBody = isPhysical && !isPhantom;
// The only time the physics scene shouldn't know about the prim is if it's phantom or an attachment, which is phantom by definition
// or flexible
if (!isPhantom && !IsAttachment && !(Shape.PathCurve == (byte) Extrusion.Flexible))
{
PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape(
Name,
Shape,
AbsolutePosition,
Scale,
RotationOffset,
RigidBody);
// Basic Physics returns null.. joy joy joy.
if (PhysActor != null)
{
PhysActor.SOPName = this.Name; // save object name and desc into the PhysActor so ODE internals know the joint/body info
PhysActor.SOPDescription = this.Description;
PhysActor.LocalID = LocalId;
DoPhysicsPropertyUpdate(RigidBody, true);
PhysActor.SetVolumeDetect(VolumeDetectActive ? 1 : 0);
}
}
}
}