private void Initialize()
        {
            // Allocate all lists:
            if (implementations == null)
            {
                implementations = new List <IColliderWorldImpl>();
            }

            if (colliderHandles == null)
            {
                colliderHandles = new List <ObiColliderHandle>();
            }
            if (colliderShapes == null)
            {
                colliderShapes = new ObiNativeColliderShapeList();
            }
            if (colliderAabbs == null)
            {
                colliderAabbs = new ObiNativeAabbList();
            }
            if (colliderTransforms == null)
            {
                colliderTransforms = new ObiNativeAffineTransformList();
            }

            if (materialHandles == null)
            {
                materialHandles = new List <ObiCollisionMaterialHandle>();
            }
            if (collisionMaterials == null)
            {
                collisionMaterials = new ObiNativeCollisionMaterialList();
            }

            if (rigidbodyHandles == null)
            {
                rigidbodyHandles = new List <ObiRigidbodyHandle>();
            }
            if (rigidbodies == null)
            {
                rigidbodies = new ObiNativeRigidbodyList();
            }

            if (triangleMeshContainer == null)
            {
                triangleMeshContainer = new ObiTriangleMeshContainer();
            }
            if (edgeMeshContainer == null)
            {
                edgeMeshContainer = new ObiEdgeMeshContainer();
            }
            if (distanceFieldContainer == null)
            {
                distanceFieldContainer = new ObiDistanceFieldContainer();
            }
            if (heightFieldContainer == null)
            {
                heightFieldContainer = new ObiHeightFieldContainer();
            }
        }
 public void SetColliders(ObiNativeColliderShapeList shapes, ObiNativeAabbList bounds, ObiNativeAffineTransformList transforms, int count)
 {
     Oni.SetColliders(shapes.GetIntPtr(), bounds.GetIntPtr(), transforms.GetIntPtr(), count);
 }
Esempio n. 3
0
        public void SetColliders(ObiNativeColliderShapeList shapes, ObiNativeAabbList bounds, ObiNativeAffineTransformList transforms, int count)
        {
            colliderCount = count;

            // insert new empty cellspans at the end if needed:
            while (colliderCount > cellSpans.count)
            {
                cellSpans.Add(new CellSpan(new VInt4(10000), new VInt4(10000)));
            }
        }