Esempio n. 1
0
 public void OnParallelTriggerExit(IParallelRigidbody2D other)
 {
     foreach (IParallelTrigger2D trigger in parallelTriggers)
     {
         trigger.OnParallelTriggerExit2D(other as ParallelRigidbody2D);
     }
 }
Esempio n. 2
0
        public static void DestoryBody(PBody2D body2D, IParallelRigidbody2D rigidBody2D)
        {
            if (!initialized)
            {
                Initialize();
            }

            if (bodySortedList.ContainsKey(body2D.BodyID))
            {
                bodySortedList.Remove(body2D.BodyID);
            }

            NativeParallel2D.DestroyBody(internalWorld.IntPointer, body2D.IntPointer);
        }
Esempio n. 3
0
        public PBody2D(IntPtr intPtr, UInt16 bodyID, IParallelRigidbody2D rigidBody, UInt16 exportSize) : base(intPtr)
        {
            BodyID    = bodyID;
            RigidBody = rigidBody;

            bodyExports      = new PBodyExport2D[exportSize];
            _exportsCapacity = exportSize;

            _index    = 0;
            _maxIndex = 0;
            _maxStep  = 0;
            _minStep  = 0;

            _initialized = false;
        }
Esempio n. 4
0
        //2D body
        public static PBody2D AddBody
            (int bodyType,
            Fix64Vec2 position,
            Fix64 angle,
            Fix64 linearDamping,
            Fix64 angularDamping,
            bool fixedRotation,
            Fix64 gravityScale,
            IParallelRigidbody2D rigidBody2D)
        {
            if (!initialized)
            {
                Initialize();
            }

            UInt16 bodyID = 0;

            IntPtr m_NativeObject = NativeParallel2D.CreateBody(
                internalWorld.IntPointer,
                bodyType,
                position,
                angle,
                linearDamping,
                angularDamping,
                fixedRotation,
                gravityScale,
                ref bodyID);

            PBody2D body2D = new PBody2D(m_NativeObject, bodyID, rigidBody2D as ParallelRigidbody2D, bodyExportSize);

            bodySortedList[bodyID] = body2D;

            ReadNativeBody(body2D);

            return(body2D);
        }
Esempio n. 5
0
 internal void SetContact(PContact2D contact, IParallelRigidbody2D rigidBody)
 {
     _contact       = contact;
     otherRigidbody = rigidBody;
 }