public PhysxPhysicWorld(Vector3 gravity, bool connectToRemoteDebugger = false)
        {
            physix = new PhysX.Physics(new ErrorCallbackImp(), true);            
            
            var sceneDesc = new SceneDesc()
            {
                Gravity = gravity.AsPhysX()                
            };
                        
            scene = physix.CreateScene(sceneDesc);
                                    
            this.scene.SetVisualizationParameter(VisualizationParameter.Scale, 1.0f);
            this.scene.SetVisualizationParameter(VisualizationParameter.CollisionShapes, true);
            this.scene.SetVisualizationParameter(VisualizationParameter.JointLocalFrames, true);
            this.scene.SetVisualizationParameter(VisualizationParameter.JointLimits, true);
            this.scene.SetVisualizationParameter(VisualizationParameter.ParticleSystemPosition, true);
            this.scene.SetVisualizationParameter(VisualizationParameter.ActorAxes, true);            

            // Connect to the remote debugger if it's there            
            if (connectToRemoteDebugger)
            {
                physix.ConnectToRemoteDebugger("localhost");
            }
            
            objs = new List<IPhysicObject>();
            ctns = new List<IPhysicConstraint>();

            cooking = physix.CreateCooking();

        }
        public PhysxPhysicWorld(Vector3 gravity, bool connectToRemoteDebugger = false)
        {
            physix = new PhysX.Physics(new ErrorCallbackImp(), true);

            var sceneDesc = new SceneDesc()
            {
                Gravity = gravity.AsPhysX()
            };

            scene = physix.CreateScene(sceneDesc);

            this.scene.SetVisualizationParameter(VisualizationParameter.Scale, 1.0f);
            this.scene.SetVisualizationParameter(VisualizationParameter.CollisionShapes, true);
            this.scene.SetVisualizationParameter(VisualizationParameter.JointLocalFrames, true);
            this.scene.SetVisualizationParameter(VisualizationParameter.JointLimits, true);
            this.scene.SetVisualizationParameter(VisualizationParameter.ParticleSystemPosition, true);
            this.scene.SetVisualizationParameter(VisualizationParameter.ActorAxes, true);

            // Connect to the remote debugger if it's there
            if (connectToRemoteDebugger)
            {
                physix.ConnectToRemoteDebugger("localhost");
            }

            objs = new List <IPhysicObject>();
            ctns = new List <IPhysicConstraint>();

            cooking = physix.CreateCooking();
        }
Beispiel #3
0
        public static void Initialise()
        {
            var eo = new ErrorOutput();

            Foundation = new Foundation(eo);
            PVD        = new Pvd(Foundation);
            Physics    = new PhysX.Physics(Foundation, false, PVD);

            PhysicsScene = Physics.CreateScene(); // TODO: SceneDesc

            PhysicsScene.SetVisualizationParameter(VisualizationParameter.Scale, 2.0f);
            PhysicsScene.SetVisualizationParameter(VisualizationParameter.CollisionShapes, true);
            PhysicsScene.SetVisualizationParameter(VisualizationParameter.JointLocalFrames, true);
            PhysicsScene.SetVisualizationParameter(VisualizationParameter.JointLimits, true);
            PhysicsScene.SetVisualizationParameter(VisualizationParameter.ActorAxes, true);

            PVD.Connect("localhost");
        }
Beispiel #4
0
        public static void InitSDK()
        {
            Foundation fd = new Foundation(new ECB());

            pvd    = new Pvd(fd);
            py     = new PhysX.Physics(fd, true, pvd);
            SceneD = new SceneDesc
            {
                Gravity = new System.Numerics.Vector3(0, 0, 0)
            };
            Scene = py.CreateScene(SceneD);
            Scene.SetVisualizationParameter(VisualizationParameter.Scale, 2.0f);
            Scene.SetVisualizationParameter(VisualizationParameter.CollisionShapes, true);
            Scene.SetVisualizationParameter(VisualizationParameter.ActorAxes, true);
            py.Pvd.Connect("localhost");
            // Scene.Gravity = new System.Numerics.Vector3(0, 0, 0);

            //PhysX.Material dm = Scene.get
        }