protected override void Initialize() { this.iniPhysics(); //Костыль для плоскости PlaneShapeDescription planeDesc = new PlaneShapeDescription(); planeDesc.Normal = new StillDesign.PhysX.MathPrimitives.Vector3(0, 1, 0); ActorDescription actorPlane = new ActorDescription(); actorPlane.Shapes.Add(planeDesc); scene.CreateActor(actorPlane); // ElementDesc wheelDesc = new ElementDesc(); wheelDesc.TypeJoint = "Cylindrical"; wheelDesc.GlobalPosition = new StillDesign.PhysX.MathPrimitives.Vector3(2.0f, 200.0f, 2.0f); camera = new myCamera.Camera(this); Car car = new Car(this, 1, "car", new Vector3(2.0f, 30.0f, 0.0f)); car.ElementsDesc.Add("wheel1", wheelDesc); Wheel wheel = new Wheel(this, 2, "wheel"); car.addElement("Cylindrical", wheel); elements.Add(wheel); //car.addElement(new Motor(this, 3)); elements.Add(car); Components.Add(camera); base.Initialize(); }
protected override void Initialize() { this.iniPhysics(); //Костыль для плоскости PlaneShapeDescription planeDesc = new PlaneShapeDescription(); planeDesc.Normal = new StillDesign.PhysX.MathPrimitives.Vector3(0, 1, 0); ActorDescription actorPlane = new ActorDescription(); actorPlane.Shapes.Add(planeDesc); scene.CreateActor(actorPlane); // ElementDesc wheelDesc = new ElementDesc(); wheelDesc.TypeJoint = "Cylindrical"; wheelDesc.GlobalPosition = new StillDesign.PhysX.MathPrimitives.Vector3(2.0f, 200.0f, 2.0f); camera = new myCamera.Camera(this); Car car = new Car(this, 1, "car", new Vector3(2.0f,30.0f,0.0f)); car.ElementsDesc.Add("wheel1", wheelDesc); Wheel wheel = new Wheel(this, 2, "wheel"); car.addElement("Cylindrical", wheel); elements.Add(wheel); //car.addElement(new Motor(this, 3)); elements.Add(car); Components.Add(camera); base.Initialize(); }