Beispiel #1
0
 internal CollisionWorld(NativeArray <RigidBody> bodies, Broadphase broadphase)
 {
     m_Bodies           = bodies;
     Broadphase         = broadphase;
     EntityBodyIndexMap = new NativeHashMap <Entity, int>(m_Bodies.Length, Allocator.Persistent);
 }
Beispiel #2
0
        public sfloat                                  CollisionTolerance => sfloat.FromRaw(0x3a83126f); // todo - make this configurable?

        // Construct a collision world with the given number of uninitialized rigid bodies
        public CollisionWorld(int numStaticBodies, int numDynamicBodies)
        {
            m_Bodies           = new NativeArray <RigidBody>(numStaticBodies + numDynamicBodies, Allocator.Persistent, NativeArrayOptions.UninitializedMemory);
            Broadphase         = new Broadphase(numStaticBodies, numDynamicBodies);
            EntityBodyIndexMap = new NativeHashMap <Entity, int>(m_Bodies.Length, Allocator.Persistent);
        }