示例#1
0
 public void SetLocalPose(ref PhyTransform transform)
 {
     unsafe
     {
         fixed(PhyTransform *p = &transform)
         {
             SDK_PhyShape_SetLocalPose(CoreObject, p);
         }
     }
 }
示例#2
0
 public bool SetPose2Physics(ref PhyTransform transform, bool autowake = true)
 {
     unsafe
     {
         fixed(PhyTransform *p = &transform)
         {
             return(SDK_PhyActor_SetPose2Physics(CoreObject, p, vBOOL.FromBoolean(autowake)));
         }
     }
 }
示例#3
0
        public CPhyActor CreateActor(EPhyActorType type, ref PhyTransform pose)
        {
            CPhyActor.NativePointer ptr;
            unsafe
            {
                fixed(PhyTransform *p = &pose)
                {
                    ptr = SDK_PhyContext_CreateActor(CoreObject, type, p);
                }
            }

            var ret = new CPhyActor(ptr, type);

            return(ret);
        }
示例#4
0
        public bool AddToActor(CPhyActor actor, ref PhyTransform transform)
        {
            if (actor == mActor)
            {
                return(true);
            }

            if (mActor != null)
            {
                mActor.Shapes.Remove(this);
            }
            mActor = actor;
            if (mActor != null)
            {
                //TODO..
                Vector3 center = mActor.HostActor.GetAABBCenter();
                Vector3 pos    = mActor.HostActor.Placement.Location;
                CenterOffset = center - pos;
                mActor.Shapes.Add(this);
            }

            if (actor == null)
            {
                if (ShapeDesc != null)
                {
                    ShapeDesc.onChangePlacement -= onChangePlacement;
                    ShapeDesc.onChangeShapeSize -= onChangeShapeSize;
                }
            }

            unsafe
            {
                fixed(PhyTransform *p = &transform)
                {
                    if (mActor != null)
                    {
                        return(SDK_PhyShape_AddToActor(CoreObject, actor.CoreObject, p));
                    }
                    else
                    {
                        return(SDK_PhyShape_AddToActor(CoreObject, CPhyActor.GetEmptyNativePointer(), p));
                    }
                }
            }
        }