Beispiel #1
0
        protected override void constructed()
        {
            joint = Owner.getElement(jointName) as Generic6DofConstraintElement;
            if (joint == null)
            {
                blacklist("Could not find Joint {0}.", jointName);
            }

            originalPosition = joint.getFrameOffsetOriginA();

            rigidBody = Owner.getElement(rigidBodyName) as RigidBody;
            if (rigidBody == null)
            {
                blacklist("Could not find RigidBody {0}", rigidBodyName);
            }
            rigidBody.ContactStarted += new CollisionCallback(rigidBody_ContactStarted);
            rigidBody.ContactEnded   += new CollisionCallback(rigidBody_ContactEnded);

            skinObject = Owner.getOtherSimObject(skinSimObjectName);
            if (skinObject == null)
            {
                blacklist("Could not find Target skin SimObject {0}.", skinSimObjectName);
            }

            SceneNodeElement node = skinObject.getElement(skinNodeName) as SceneNodeElement;

            if (node == null)
            {
                blacklist("Could not find target skin SceneNodeElement {0}.", skinSimObjectName);
            }

            Entity entity = node.getNodeObject(skinEntityName) as Entity;

            if (entity == null)
            {
                blacklist("Could not find skin Entity {0}.", skinNodeName);
            }

            if (!entity.hasSkeleton())
            {
                blacklist("Skin Entity {0} does not have a skeleton.", skinEntityName);
            }

            SkeletonInstance skeleton = entity.getSkeleton();

            if (skeleton.hasBone(lipBoneName))
            {
                lipBone = skeleton.getBone(lipBoneName);
                lipBone.setManuallyControlled(true);
                offset       = lipBone.getPosition() + skinObject.Translation - this.Owner.Translation;
                lastPosition = this.Owner.Translation;
            }
            else
            {
                blacklist("Cannot find bone {0} in Skin Entity {1} in SimObject {2}", lipBoneName, skinEntityName, skinSimObjectName);
            }
        }
Beispiel #2
0
        protected override void constructed()
        {
            rigidBody = Owner.getElement(RigidBodyName) as RigidBody;
            if (rigidBody == null)
            {
                blacklist("Cannot find RigidBody '{0}'.", RigidBodyName);
            }

            joint = (Generic6DofConstraintElement)Owner.getElement(JointName);

            if (joint != null)
            {
                jointStartTranslation = joint.getFrameOffsetOriginA();
                jointStartRotation    = joint.getFrameOffsetBasisA();
                rigidBody.raiseCollisionFlag(CollisionFlags.KinematicObject);
                moveOntoMandible();
            }

            JointLocked = true;
        }
Beispiel #3
0
        protected override void constructed()
        {
            sceneNodeElement = Owner.getElement(sceneNodeName) as SceneNodeElement;
            if (sceneNodeElement == null)
            {
                blacklist("Could not find SceneNodeElement {0}.", sceneNodeName);
            }
            entity = sceneNodeElement.getNodeObject(entityName) as Entity;
            if (entity == null)
            {
                blacklist("Could not find Entity {0}.", entityName);
            }

            actorElement = Owner.getElement(actorName) as RigidBody;
            if (actorElement == null)
            {
                blacklist("Could not find Actor {0}.", actorName);
            }
            SleepyActorRepository.addSleeper(actorElement);

            joint = Owner.getElement(jointName) as Generic6DofConstraintElement;
            if (joint == null)
            {
                blacklist("Could not find Joint {0}.", jointName);
            }
            startingLocation = joint.getFrameOffsetOriginA();
            startingRotation = joint.getFrameOffsetBasisA();

            transparency = Owner.getElement(transparencyInterface) as TransparencyInterface;
            if (transparency == null)
            {
                blacklist("Could not find TransparencyInterface {0}", transparencyInterface);
            }
            TeethController.addTooth(Owner.Name, this);
            HighlightColor = Color.White;
        }