protected override void OnInitializePhysics() { // collision configuration contains default setup for memory, collision setup CollisionConf = new DefaultCollisionConfiguration(); Dispatcher = new CollisionDispatcher(CollisionConf); Broadphase = new DbvtBroadphase(); Solver = new SequentialImpulseConstraintSolver(); World = new DiscreteDynamicsWorld(Dispatcher, Broadphase, Solver, CollisionConf); World.Gravity = Freelook.Up * -10.0f; var bspLoader = new BspLoader(); string[] args = Environment.GetCommandLineArgs(); if (args.Length == 1) { bspLoader.LoadBspFile(Path.Combine("data", "BspDemo.bsp")); } else { bspLoader.LoadBspFile(args[1]); } BspConverter bsp2Bullet = new BspToBulletConverter(this); bsp2Bullet.ConvertBsp(bspLoader, 0.1f); }
protected override void OnInitializePhysics() { // collision configuration contains default setup for memory, collision setup CollisionConf = new DefaultCollisionConfiguration(); Dispatcher = new CollisionDispatcher(CollisionConf); Broadphase = new DbvtBroadphase(); Solver = new SequentialImpulseConstraintSolver(); World = new DiscreteDynamicsWorld(Dispatcher, Broadphase, Solver, CollisionConf); World.Gravity = Freelook.Up * -10.0f; BspLoader bspLoader = new BspLoader(); string[] args = Environment.GetCommandLineArgs(); if (args.Length == 1) { bspLoader.LoadBspFile("data/BspDemo.bsp"); } else { bspLoader.LoadBspFile(args[1]); } BspConverter bsp2Bullet = new BspToBulletConverter(this); bsp2Bullet.ConvertBsp(bspLoader, 0.1f); }
protected override void OnInitializePhysics() { // collision configuration contains default setup for memory, collision setup CollisionConf = new DefaultCollisionConfiguration(); Dispatcher = new CollisionDispatcher(CollisionConf); Broadphase = new DbvtBroadphase(); Solver = new SequentialImpulseConstraintSolver(); World = new DiscreteDynamicsWorld(Dispatcher, Broadphase, Solver, CollisionConf); World.Gravity = Freelook.Up * -10.0f; BspLoader bspLoader = new BspLoader(); //string[] args = Environment.GetCommandLineArgs(); //if (args.Length == 1) //{ UnityEngine.TextAsset bytes = (UnityEngine.TextAsset)UnityEngine.Resources.Load("BspDemo"); System.IO.Stream byteStream = new System.IO.MemoryStream(bytes.bytes); bspLoader.LoadBspFile(byteStream); //} //else //{ // bspLoader.LoadBspFile(args[1]); //} BspConverter bsp2Bullet = new BspToBulletConverter(this); bsp2Bullet.ConvertBsp(bspLoader, 0.1f); }
public Physics() { // collision configuration contains default setup for memory, collision setup CollisionConf = new DefaultCollisionConfiguration(); Dispatcher = new CollisionDispatcher(CollisionConf); Broadphase = new DbvtBroadphase(); Solver = new SequentialImpulseConstraintSolver(); World = new DiscreteDynamicsWorld(Dispatcher, Broadphase, Solver, CollisionConf); World.Gravity = new Vector3(0, 0, -10); BspLoader bspLoader = new BspLoader(); bspLoader.LoadBspFile("BspDemo.bsp"); BspConverter bsp2Bullet = new BspToBulletConverter(this); bsp2Bullet.ConvertBsp(bspLoader, 0.1f); }
private void LoadBspFile() { var bspLoader = new BspLoader(); string[] args = Environment.GetCommandLineArgs(); if (args.Length == 1) { bspLoader.LoadBspFile(Path.Combine("data", "BspDemo.bsp")); } else { bspLoader.LoadBspFile(args[1]); } var bsp2Bullet = new BspToBulletConverter(World); bsp2Bullet.ConvertBsp(bspLoader, 0.1f); }