本文整理汇总了C#中InWorldz.PhysxPhysics.PhysxPrim类的典型用法代码示例。如果您正苦于以下问题:C# PhysxPrim类的具体用法?C# PhysxPrim怎么用?C# PhysxPrim使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PhysxPrim类属于InWorldz.PhysxPhysics命名空间,在下文中一共展示了PhysxPrim类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AvatarKicked
internal void AvatarKicked(PhysxPrim physxPrim)
{
if (_standingOnPrim == physxPrim)
{
AvatarNotStandingOnPrim();
}
}
示例2: AvatarStandingOn
public void AvatarStandingOn(PhysxPrim prim)
{
if (_standingOnPrim != prim)
{
_timeBeganStandingOnPrim = (uint)Environment.TickCount;
_standingOnPrim = prim;
}
}
示例3: PrimWantsCollisionRepeat
public void PrimWantsCollisionRepeat(PhysxPrim prim)
{
_collisionRepeatPrims.Add(prim);
}
示例4: BeginDelayCommands
internal void BeginDelayCommands(PhysxPrim prim, Commands.ICommand initiator)
{
DelayedCommandInfo info = new DelayedCommandInfo { Commands = new LinkedList<Commands.ICommand>(), Initiator = initiator };
_delayedCommands.Add(prim, info);
}
示例5: RemovePrim
internal void RemovePrim(PhysxPrim prim)
{
_dynPrims.Remove(prim);
_allPrims.Remove(prim);
_collisionRepeatPrims.Remove(prim);
_kinematicManager.KinematicRemoved(prim);
_delayedCommands.Remove(prim);
prim.Dispose();
}
示例6: PrimMadeStaticKinematic
internal void PrimMadeStaticKinematic(PhysxPrim actor)
{
_dynPrims.Remove(actor);
_kinematicManager.KinematicChanged(actor);
}
示例7: AddPrimSync
internal void AddPrimSync(PhysxPrim prim, bool physical, bool kinematicStatic)
{
_allPrims.Add(prim);
if (physical) _dynPrims.Add(prim);
if (kinematicStatic) _kinematicManager.KinematicChanged(prim);
}
示例8: HandlePrimChangedShape
private void HandlePrimChangedShape(PhysxPrim prim, TaintType taint)
{
this.QueueCommand(new Commands.ChangedShapeCmd(prim));
}
示例9: ContactedActorDeleted
private void ContactedActorDeleted(PhysxPrim deletedActor, PhysxPrim ourActor)
{
if (!_touchCounts.IsValueCreated) return;
int touchCount;
if (_touchCounts.Value.TryGetValue(deletedActor, out touchCount))
{
ProcessContactChange(-touchCount, ourActor, deletedActor);
}
}
示例10: PhysxPrim
public PhysxPrim(PhysxPrim parent, PhysxScene scene, PrimitiveBaseShape baseShape, OpenMetaverse.Vector3 pos,
OpenMetaverse.Quaternion rotation, PhysicsShape myShape, PhysX.RigidActor myActor,
bool isPhysical, IPhysicsProperties properties, CollisionGroupFlag collisionGroup)
{
_parentPrim = parent;
_scene = scene;
_pbs = baseShape;
_position = pos;
_rotation = rotation;
_isPhysical = isPhysical;
_properties = (PhysicsProperties)properties;
_collisionGroup = collisionGroup;
this.AssignActor(myActor, myShape, _isPhysical, DeleteActorFlags.None);
if (_properties.VehicleProps != null && _properties.VehicleProps.Type != VehicleType.None)
{
//init dynamics
CheckCreateVehicleDynamics();
}
}
示例11: ReplaceMaterialOnShapes
private void ReplaceMaterialOnShapes(Material material, PhysxPrim affectedPrim, IEnumerable<PhysX.Shape> shapes)
{
Material oldMaterial = affectedPrim.PhysxProperties.PhysxMaterial;
affectedPrim.PhysxProperties.PhysxMaterial = material;
PhysX.Material[] materialArr = new PhysX.Material[] { material.PhyMaterial };
foreach (PhysX.Shape shape in shapes)
{
shape.SetMaterials(materialArr);
}
if (oldMaterial.Density != material.Density) UpdateMassAndInertia();
oldMaterial.CheckedDispose();
}
示例12: SetMaterialSync
/// <summary>
/// Sets the given prim in our linkset to the given material
/// </summary>
/// <param name="material"></param>
/// <param name="affectedPrim"></param>
private void SetMaterialSync(Material material, PhysxPrim affectedPrim, bool applyToObject)
{
IEnumerable<PhysX.Shape> shapes;
if (applyToObject)
{
ReplaceMaterialOnAllShapes(material);
return;
}
if (affectedPrim == this)
{
shapes = _actor.Shapes;
}
else
{
RelatedShapes childShapes;
if (_childShapes.TryGetValue(affectedPrim, out childShapes))
{
shapes = childShapes.PhyShapes;
}
else
{
m_log.ErrorFormat("[InWorldz.PhysxPhysics] Asked to set material for unknown child shape");
return;
}
}
ReplaceMaterialOnShapes(material, affectedPrim, shapes);
}
示例13: HandleTrackedCharacterContactChange
private void HandleTrackedCharacterContactChange(int change, PhysxPrim ourPrim, PhysX.Shape primShape, PhysxCharacter other)
{
HashSet<PhysX.Shape> collidingShapes;
if (!_avatarTouchCounts.Value.TryGetValue(other, out collidingShapes))
{
if (change < 0)
{
//we have no record of colliding with this object. therefore removing a
//collision leaves no change to state
return;
}
collidingShapes = new HashSet<PhysX.Shape>();
_avatarTouchCounts.Value[other] = collidingShapes;
}
if (change > 0 && !collidingShapes.Add(primShape))
{
//we're already colliding with this object. no change in state
return;
}
else if (change < 0 && !collidingShapes.Remove(primShape))
{
//we weren't colliding with this object. no change in state
return;
}
int newTotal = collidingShapes.Count;
//m_log.DebugFormat("Char Contact Change: This: {0}, Other: {1}, Chg: {2}, Tot: {3}", this.SOPName, other.SOPName, change, collidingShapes.Count);
if (newTotal == 0 && change < 0)
{
//we've lost all contact with this prim, notify of collision_end
ourPrim.SendCollisionUpdate(new CollisionEventUpdate { OtherColliderLocalId = other.LocalID, Type = CollisionEventUpdateType.CharacterCollisionEnded });
_avatarTouchCounts.Value.Remove(other);
return;
}
if (newTotal == 1 && change > 0)
{
//we have begun colliding with a new object
ourPrim.SendCollisionUpdate(new CollisionEventUpdate { OtherColliderLocalId = other.LocalID, Type = CollisionEventUpdateType.CharacterCollisionBegan });
}
return;
}
示例14: ProcessCharacterContactChange
/// <summary>
/// Called when a change has been posted for touches between one of our prims and an avatar. We must track
/// these touches by shape because the collision detection is sometimes one sided in the case of an avatar
/// touching a prim
/// </summary>
/// <param name="change"></param>
/// <param name="other"></param>
private void ProcessCharacterContactChange(int change, PhysxPrim ourPrim, PhysX.Shape primShape, PhysxCharacter other)
{
if (IsChild && _properties.WantsCollisionNotification)
{
HandleTrackedCharacterContactChange(change, ourPrim, primShape, other);
}
else if (IsChild && !_properties.WantsCollisionNotification)
{
_parentPrim.ProcessCharacterContactChange(change, ourPrim, primShape, other);
}
else if (HasActor && (_properties.WantsCollisionNotification || _properties.ChildrenWantCollisionNotification))
{
HandleTrackedCharacterContactChange(change, ourPrim, primShape, other);
}
}
示例15: HandlePrimMadeStatic
private void HandlePrimMadeStatic(PhysxPrim prim, TaintType taint)
{
this.QueueCommand(new Commands.SetPhysicalityCmd(prim, false));
}