• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# PhysxPhysics.PhysxPrim类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中InWorldz.PhysxPhysics.PhysxPrim的典型用法代码示例。如果您正苦于以下问题:C# PhysxPrim类的具体用法?C# PhysxPrim怎么用?C# PhysxPrim使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PhysxPrim类属于InWorldz.PhysxPhysics命名空间,在下文中一共展示了PhysxPrim类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AvatarKicked

 internal void AvatarKicked(PhysxPrim physxPrim)
 {
     if (_standingOnPrim == physxPrim)
     {
         AvatarNotStandingOnPrim();
     }
 }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:7,代码来源:CharacterRideOnBehavior.cs


示例2: AvatarStandingOn

 public void AvatarStandingOn(PhysxPrim prim)
 {
     if (_standingOnPrim != prim)
     {
         _timeBeganStandingOnPrim = (uint)Environment.TickCount;
         _standingOnPrim = prim;
     }
 }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:8,代码来源:CharacterRideOnBehavior.cs


示例3: PrimWantsCollisionRepeat

 public void PrimWantsCollisionRepeat(PhysxPrim prim)
 {
     _collisionRepeatPrims.Add(prim);
 }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:4,代码来源:PhysxScene.cs


示例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);
 }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:5,代码来源:PhysxScene.cs


示例5: RemovePrim

 internal void RemovePrim(PhysxPrim prim)
 {
     _dynPrims.Remove(prim);
     _allPrims.Remove(prim);
     _collisionRepeatPrims.Remove(prim);
     _kinematicManager.KinematicRemoved(prim);
     _delayedCommands.Remove(prim);
     prim.Dispose();
 }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:9,代码来源:PhysxScene.cs


示例6: PrimMadeStaticKinematic

 internal void PrimMadeStaticKinematic(PhysxPrim actor)
 {
     _dynPrims.Remove(actor);
     _kinematicManager.KinematicChanged(actor);
 }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:5,代码来源:PhysxScene.cs


示例7: AddPrimSync

 internal void AddPrimSync(PhysxPrim prim, bool physical, bool kinematicStatic)
 {
     _allPrims.Add(prim);
     if (physical) _dynPrims.Add(prim);
     if (kinematicStatic) _kinematicManager.KinematicChanged(prim);
 }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:6,代码来源:PhysxScene.cs


示例8: HandlePrimChangedShape

 private void HandlePrimChangedShape(PhysxPrim prim, TaintType taint)
 {
     this.QueueCommand(new Commands.ChangedShapeCmd(prim));
 }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:4,代码来源:PhysxScene.cs


示例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);
            }
        }
开发者ID:digitalmystic,项目名称:halcyon,代码行数:10,代码来源:PhysxPrim.cs


示例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();
            }
        }
开发者ID:digitalmystic,项目名称:halcyon,代码行数:21,代码来源:PhysxPrim.cs


示例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();
        }
开发者ID:digitalmystic,项目名称:halcyon,代码行数:15,代码来源:PhysxPrim.cs


示例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);
        }
开发者ID:digitalmystic,项目名称:halcyon,代码行数:36,代码来源:PhysxPrim.cs


示例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;
        }
开发者ID:digitalmystic,项目名称:halcyon,代码行数:48,代码来源:PhysxPrim.cs


示例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);
     }
 }
开发者ID:digitalmystic,项目名称:halcyon,代码行数:22,代码来源:PhysxPrim.cs


示例15: HandlePrimMadeStatic

 private void HandlePrimMadeStatic(PhysxPrim prim, TaintType taint)
 {
     this.QueueCommand(new Commands.SetPhysicalityCmd(prim, false));
 }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:4,代码来源:PhysxScene.cs


示例16: HandlePrimMadeDynamic

 private void HandlePrimMadeDynamic(PhysxPrim prim, TaintType taint)
 {
     this.QueueCommand(new Commands.SetPhysicalityCmd(prim, true));
 }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:4,代码来源:PhysxScene.cs


示例17: InvalidateControllerCacheIfContacting

 /// <summary>
 /// Called when a prim actor shape changes or an actor is deleted.
 /// This invalidates the controller cache to prevent PhysX crashes
 /// due to bugs
 /// </summary>
 /// <param name="prim"></param>
 internal void InvalidateControllerCacheIfContacting(PhysxPrim prim)
 {
     if (_collidingPrims.ContainsKey(prim))
     {
         _controller.InvalidateCache();
     }
 }
开发者ID:digitalmystic,项目名称:halcyon,代码行数:13,代码来源:PhysxCharacter.cs


示例18: CheckAddDelay

        private bool CheckAddDelay(Commands.ICommand cmd, PhysxPrim target)
        {
            DelayedCommandInfo delayInfo;
            if (_delayedCommands.TryGetValue(target, out delayInfo) && delayInfo.Initiator != cmd)
            {
                //if we're already the last delayed command delayed behind the other command
                //for the given prim, we only need to be added once per command so we can safely
                //just return
                if (delayInfo.Commands.Count > 0 && delayInfo.Commands.Last.Value == cmd)
                {
                    return true;
                }

                //before adding this new command to wait, check to see if it is cullable.
                //if the command is cullable, and has the same targets, we replace it with this command
                //maintaining its position in the queue
                LinkedListNode<Commands.ICommand> cmdNode;
                if (cmd.IsCullable
                    && delayInfo.TopCullables != null && delayInfo.TopCullables.TryGetValue(cmd.GetType(), out cmdNode)
                    && HasSameTargets(cmdNode.Value, cmd))
                {
                    cmdNode.Value = cmd;
                    if (cmd.AffectsMultiplePrims()) ((Commands.IMultiPrimCommand)cmd).AddDelay();

                    return true;
                }
                else
                {
                    cmdNode = delayInfo.Commands.AddLast(cmd);
                    if (cmd.AffectsMultiplePrims()) ((Commands.IMultiPrimCommand)cmd).AddDelay();

                    if (cmd.IsCullable)
                    {
                        if (delayInfo.TopCullables == null)
                        {
                            delayInfo.TopCullables = new Dictionary<Type, LinkedListNode<Commands.ICommand>>();
                        }

                        delayInfo.TopCullables.Add(cmd.GetType(), cmdNode);
                    }

                    return true;
                }
            }

            return false;
        }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:47,代码来源:PhysxScene.cs


示例19: SetToRemoveAfterReport

 private void SetToRemoveAfterReport(PhysX.Shape otherShape, PhysxPrim colPrim)
 {
     ExternalReport report;
     if (_externalCollisionReports.TryGetValue(otherShape, out report))
     {
         if (report.Reported)
         {
             //this collision was reported already. remove it
             RemoveExternalCollidingPrimShape(otherShape, colPrim);
         }
         else
         {
             //this collision hasn't been reported yet. make sure the 
             //collision processor knows to remove it after it is reported
             report.RemoveAfterReport = true;
         }
     }
 }
开发者ID:digitalmystic,项目名称:halcyon,代码行数:18,代码来源:PhysxCharacter.cs


示例20: PrimMadeDynamic

 internal void PrimMadeDynamic(PhysxPrim prim)
 {
     _dynPrims.Add(prim);
     _kinematicManager.KinematicRemoved(prim);
 }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:5,代码来源:PhysxScene.cs



注:本文中的InWorldz.PhysxPhysics.PhysxPrim类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Infiniminer.Player类代码示例发布时间:2022-05-26
下一篇:
C# Glue.SyscallShim类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap