protected override void constructed() { this.addToDebugDrawing(); multiProp = Owner.getElement(multiPropName) as MultiProp; if (multiProp == null) { blacklist("Cannot find MultiProp '{0}'", multiPropName); } multiProp.beginUpdates(); using (var stream = VirtualFileSystem.Instance.openStream("Plugins/SplintProps/PartModels/SplintSpace.positions", Engine.Resources.FileMode.Open)) { PositionCollection positions = new PositionCollection(stream); for (int i = StartIndex; i < EndIndex; ++i) { var position = positions.getPosition(String.Format("BaseSplint{0}", i)); multiProp.addSection(new MultiPropSection(String.Format("SplintSection{0}", i), String.Format("BaseSplint{0}.mesh", i), String.Format("BaseSplintCol{0}", i), position.Translation, position.Rotation, new Vector3(1f, 0.2f, 1f))); } } multiProp.finishUpdates(); base.constructed(); }
internal void destroy(MultiProp multiProp) { entity.detachFromParent(); multiProp.OgreSceneManager.SceneManager.destroyEntity(entity); multiProp.MainNode.removeChild(node); multiProp.OgreSceneManager.SceneManager.destroySceneNode(node); multiProp.RigidBody.destroySection(rigidBodySection); }
protected override void constructed() { multiProp = Owner.getElement(multiPropName) as MultiProp; if (multiProp == null) { blacklist("Cannot find MultiProp '{0}'", multiPropName); } woot1 = multiProp.addSection(new MultiPropSection("Woot1", "Box016.mesh", "Box016", new Vector3(-1, 0, 0), Quaternion.Identity, Vector3.ScaleIdentity)); woot2 = multiProp.addSection(new MultiPropSection("Woot2", "Box016.mesh", "Box016", new Vector3(1, 0, 0), Quaternion.Identity, Vector3.ScaleIdentity)); woot3 = multiProp.addSection(new MultiPropSection("Woot3", "PerfTooth01.mesh", "Tooth1collision", new Vector3(0, 0, 1), Quaternion.Identity, Vector3.ScaleIdentity)); base.constructed(); }
internal void create(MultiProp multiProp) { node = multiProp.OgreSceneManager.SceneManager.createSceneNode(String.Format("{0}_MultiPropNode_{1}", multiProp.Owner.Name, name)); node.setPosition(Translation); node.setOrientation(Rotation); node.setScale(Scale); multiProp.MainNode.addChild(node); entity = multiProp.OgreSceneManager.SceneManager.createEntity(String.Format("{0}_MultiPropEntity_{1}", multiProp.Owner.Name, name), mesh); node.attachObject(entity); rigidBodySection = multiProp.RigidBody.createSection(collision, Translation, Rotation, Scale); if (rigidBodySection == null) { Logging.Log.Error("Cannot find collision shape '{0}'", collision); } }
protected override void constructed() { joint = Owner.getElement(jointName) as TypedConstraintElement; if (joint == null) { blacklist("Could not find Joint {0}.", jointName); } multiProp = Owner.getElement(multiPropName) as MultiProp; if (multiProp == null) { blacklist("Cannot find MultiProp '{0}'", multiPropName); } multiProp.UpdatesStarting += MultiProp_UpdatesStarting; multiProp.UpdatesCompleted += MultiProp_UpdatesCompleted; base.constructed(); }
private void MultiProp_UpdatesStarting(MultiProp obj) { joint.beginUpdate(); }
private void MultiProp_UpdatesCompleted(MultiProp obj) { joint.updateCompleted(); }