Inheritance: IDisposable
Esempio n. 1
0
 public void defaultCollisionHandler(btSoftBody psb)
 {
     BulletSoftBodyPINVOKE.btSoftBody_defaultCollisionHandler__SWIG_1(swigCPtr, btSoftBody.getCPtr(psb));
 }
Esempio n. 2
0
 public void appendLinearJoint(SWIGTYPE_p_LJoint__Specs specs, btSoftBody body)
 {
     BulletSoftBodyPINVOKE.btSoftBody_appendLinearJoint__SWIG_3(swigCPtr, SWIGTYPE_p_LJoint__Specs.getCPtr(specs), btSoftBody.getCPtr(body));
     if (BulletSoftBodyPINVOKE.SWIGPendingException.Pending) throw BulletSoftBodyPINVOKE.SWIGPendingException.Retrieve();
 }
Esempio n. 3
0
 public void appendLinearJoint(SWIGTYPE_p_btVector3 position, btSoftBody softbody)
 {
     BulletSoftBodyPINVOKE.btSoftBody_appendLinearJoint__SWIG_4(swigCPtr, SWIGTYPE_p_btVector3.getCPtr(position), btSoftBody.getCPtr(softbody));
     if (BulletSoftBodyPINVOKE.SWIGPendingException.Pending) throw BulletSoftBodyPINVOKE.SWIGPendingException.Retrieve();
 }
Esempio n. 4
0
 public static void PSolve_SContacts(btSoftBody psb, float arg1, float ti)
 {
     BulletSoftBodyPINVOKE.btSoftBody_PSolve_SContacts(btSoftBody.getCPtr(psb), arg1, ti);
 }
Esempio n. 5
0
 public static void VSolve_Links(btSoftBody psb, float kst)
 {
     BulletSoftBodyPINVOKE.btSoftBody_VSolve_Links(btSoftBody.getCPtr(psb), kst);
 }
Esempio n. 6
0
 internal static HandleRef getCPtr(btSoftBody obj)
 {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
Esempio n. 7
0
 public static void PSolve_RContacts(btSoftBody psb, float kst, float ti)
 {
     BulletSoftBodyPINVOKE.btSoftBody_PSolve_RContacts(btSoftBody.getCPtr(psb), kst, ti);
 }
Esempio n. 8
0
    public bool OnBulletCreate(btSoftBodyWorldInfo softBodyWorldInfo)
    {
        if( softBodyType == SoftBodyType.Patch )
        {
            Vector3 c00 = transform.TransformPoint(PatchCorner00);
            Vector3 c01 = transform.TransformPoint(PatchCorner01);
            Vector3 c10 = transform.TransformPoint(PatchCorner10);
            Vector3 c11 = transform.TransformPoint(PatchCorner11);

            btVector3 corner00 = new btVector3(c00.x,c00.y,c00.z);
            btVector3 corner01 = new btVector3(c01.x,c01.y,c01.z);
            btVector3 corner10 = new btVector3(c10.x,c10.y,c10.z);
            btVector3 corner11 = new btVector3(c11.x,c11.y,c11.z);

            int fixFlag = 0;
            if( CornerFix00 )
                fixFlag = 1;
            if ( CornerFix01 )
                fixFlag += 4;
            if( CornerFix10 )
                fixFlag += 2;
            if( CornerFix11 )
                fixFlag += 8;

            softBody = btSoftBodyHelpers.CreatePatch(softBodyWorldInfo,corner00.GetSwigPtr(),corner10.GetSwigPtr(),corner01.GetSwigPtr(),corner11.GetSwigPtr(),
                                                     PatchResolutionX,PatchResolutionY,fixFlag,true);
            collisionObject = btCollisionObject.GetObjectFromSwigPtr(softBody.GetCollisionObject());

            SetParam();
            SpawnMesh();

            return true;
        }
        else if( softBodyType == SoftBodyType.Ellipsoid )
        {
            btVector3 center = new btVector3(transform.position.x,transform.position.y,transform.position.z);
            btVector3 radius = new btVector3(EllipsoidRadius.x*transform.localScale.x,EllipsoidRadius.y*transform.localScale.y,
                                             EllipsoidRadius.z*transform.localScale.z);

            softBody = btSoftBodyHelpers.CreateEllipsoid(softBodyWorldInfo,center.GetSwigPtr(),radius.GetSwigPtr(),MeshResolution);
            SetParam();
            SpawnMesh();
            return true;
        }
        else if( softBodyType == SoftBodyType.Rope )
        {
            int fixFlag = 0;
            if(FixRopeBegin)
                fixFlag += 1;
            if( FixRopeEnd )
                fixFlag += 2;
            Vector3 begin = transform.TransformPoint(RopeFromPos);
            Vector3 end = transform.TransformPoint(RopeToPos);
            btVector3 fromPos = new btVector3(begin.x,begin.y,begin.z);
            btVector3 toPos = new btVector3(end.x,end.y,end.z);
            softBody = btSoftBodyHelpers.CreateRope(softBodyWorldInfo,fromPos.GetSwigPtr(),toPos.GetSwigPtr(),RopeResolution,fixFlag);
            SetParam();
            SpawnLineRender();
            return true;
        }
        else if( softBodyType == SoftBodyType.TriangleMesh )
        {
            if(CheckUnityMesh() == false)
                return false;

            CreateBulletStyleMesh();

            List<float> vertexposList = new List<float>();

            for(int index=0;index<btVectorArray.Length;index++)
            {
                Vector3 vec = btVectorArray[index];
                vec = transform.TransformPoint(vec);
                vertexposList.Add(vec.x);
                vertexposList.Add(vec.y);
                vertexposList.Add(vec.z);
            }

            softBody = btSoftBodyHelpers.CreateFromTriMesh(softBodyWorldInfo,vertexposList.ToArray(),btTriangleArray,btTriangleArray.Length/3);
            SetParam();
            return true;
        }
        return false;
    }
Esempio n. 9
0
 public bool OnBulletExit()
 {
     softBody = null;
     return true;
 }
 public void addSoftBody(btSoftBody body)
 {
     BulletSoftBodyPINVOKE.btSoftRigidDynamicsWorld_addSoftBody__SWIG_2(swigCPtr, btSoftBody.getCPtr(body));
 }
 public virtual void copySoftBodyToVertexBuffer(btSoftBody softBody, btVertexBufferDescriptor vertexBuffer)
 {
     BulletSoftBodyPINVOKE.btSoftBodySolverOutput_copySoftBodyToVertexBuffer(swigCPtr, btSoftBody.getCPtr(softBody), btVertexBufferDescriptor.getCPtr(vertexBuffer));
 }
 public void addSoftBody(btSoftBody body, short collisionFilterGroup)
 {
     BulletSoftBodyPINVOKE.btSoftRigidDynamicsWorld_addSoftBody__SWIG_1(swigCPtr, btSoftBody.getCPtr(body), collisionFilterGroup);
 }
 public void removeSoftBody(btSoftBody body)
 {
     BulletSoftBodyPINVOKE.btSoftRigidDynamicsWorld_removeSoftBody(swigCPtr, btSoftBody.getCPtr(body));
 }
Esempio n. 14
0
 public virtual void processCollision(btSoftBody arg0, btSoftBody arg1)
 {
     BulletSoftBodyPINVOKE.btSoftBodySolver_processCollision__SWIG_1(swigCPtr, btSoftBody.getCPtr(arg0), btSoftBody.getCPtr(arg1));
 }
Esempio n. 15
0
 public virtual void processCollision(btSoftBody arg0, SWIGTYPE_p_btCollisionObjectWrapper arg1)
 {
     BulletSoftBodyPINVOKE.btSoftBodySolver_processCollision__SWIG_0(swigCPtr, btSoftBody.getCPtr(arg0), SWIGTYPE_p_btCollisionObjectWrapper.getCPtr(arg1));
 }
 public override void processCollision(btSoftBody arg0, btSoftBody arg1)
 {
     BulletSoftBodyPINVOKE.btDefaultSoftBodySolver_processCollision__SWIG_1(swigCPtr, btSoftBody.getCPtr(arg0), btSoftBody.getCPtr(arg1));
 }