public override void registerScene(SimSubScene subscene, SimObjectBase instance)
 {
     if (subscene.hasSimElementManagerType(typeof(BEPUikScene)))
     {
         BEPUikScene sceneManager = subscene.getSimElementManager <BEPUikScene>();
         sceneManager.IkFactory.addJoint(this, instance);
     }
     else
     {
         Log.Default.sendMessage("Cannot add {0} {1} to SimSubScene {2} because it does not contain a BEPUikScene.", LogLevel.Warning, this.GetType().Name, BEPUikInterface.PluginName, Name, subscene.Name);
     }
 }
Beispiel #2
0
        internal override void createProduct(SimObjectBase instance, BEPUikScene scene)
        {
            BEPUikBone bone;

            if (LocalRotQuat.HasValue)
            {
                bone = new BEPUikBoneLocalRot(this, instance, scene);
            }
            else
            {
                bone = new BEPUikBone(this, instance, scene);
            }
            instance.addElement(bone);
        }
 public void renderDebug(SimSubScene subScene)
 {
     if (enabled)
     {
         BEPUikScene sceneManager = subScene.getSimElementManager <BEPUikScene>();
         if (sceneManager != null)
         {
             sceneManager.drawDebug(drawingSurface, drawMode);
         }
     }
     else if (clearDebugSurface)
     {
         drawingSurface.clearAll();
         clearDebugSurface = false;
     }
 }
Beispiel #4
0
 public void createProduct(BEPUikScene scene)
 {
     try
     {
         element.createProduct(instance, scene);
     }
     catch (BEPUikBlacklistException ex)
     {
         SimObjectErrorManager.AddAndLogError(new SimObjectError()
         {
             Subsystem   = BEPUikInterface.PluginName,
             ElementName = element.Name,
             Type        = element.GetType().Name,
             SimObject   = instance.Name,
             Message     = ex.Message
         });
     }
 }
        internal override void createProduct(SimObjectBase instance, BEPUikScene scene)
        {
            var otherObject = instance.getOtherSimObject(this.BoneSimObjectName);

            if (otherObject != null)
            {
                var bone = otherObject.getElement(this.BoneName) as BEPUikBone;
                if (bone != null)
                {
                    instance.addElement(new BEPUikDragControl(bone, scene, this, instance));
                }
                else
                {
                    Log.Default.sendMessage("Cannot add BEPUikDragControl {0} to SimObject {1} because the Sim Object does not contain a bone named {2}.", LogLevel.Warning, BEPUikInterface.PluginName, Name, BoneSimObjectName, BoneName);
                }
            }
            else
            {
                Log.Default.sendMessage("Cannot add BEPUikDragControl {0} to SimObject {1} because the Sim Object does not exist.", LogLevel.Warning, BEPUikInterface.PluginName, Name, BoneSimObjectName);
            }
        }
        internal override void createProduct(SimObjectBase instance, BEPUikScene scene)
        {
            BEPUikBone connectionA = null;
            BEPUikBone connectionB = null;

            SimObject other = instance.getOtherSimObject(ConnectionASimObjectName);

            if (other == null)
            {
                throw new BEPUikBlacklistException("Cannot find ConnectionA SimObject named '{0}'", ConnectionASimObjectName);
            }

            connectionA = other.getElement(ConnectionABoneName) as BEPUikBone;
            if (connectionA == null)
            {
                throw new BEPUikBlacklistException("Cannot find ConnectionA bone named '{0}' in '{1}'", ConnectionABoneName, ConnectionASimObjectName);
            }

            other = instance.getOtherSimObject(ConnectionBSimObjectName);
            if (other == null)
            {
                throw new BEPUikBlacklistException("Cannot find ConnectionB SimObject named '{0}'", ConnectionBSimObjectName);
            }

            connectionB = other.getElement(ConnectionBBoneName) as BEPUikBone;
            if (connectionB == null)
            {
                throw new BEPUikBlacklistException("Cannot find ConnectionB bone named '{0}' in '{1}'", ConnectionBBoneName, ConnectionBSimObjectName);
            }

            SimElement element = createConstraint(connectionA, connectionB, instance);

            if (element != null)
            {
                instance.addElement(element);
            }
        }
Beispiel #7
0
 internal abstract void createProduct(SimObjectBase instance, BEPUikScene scene);
 public BEPUIkFactory(BEPUikScene scene)
 {
     this.scene = scene;
 }
 public BEPUikSceneUpdater(BEPUikScene scene)
 {
     this.scene = scene;
 }
 public BEPUikBoneLocalRot(BEPUikBoneDefinition definition, SimObjectBase instance, BEPUikScene scene)
     : base(definition, instance, scene)
 {
     localRot            = definition.LocalRotQuat.Value;
     localRotInverse     = localRot.inverse();
     IkBone.Orientation *= localRot.toBepuQuat();
 }
Beispiel #11
0
 public BEPUikControl(BEPUikScene scene, String name)
     : base(name)
 {
     this.scene    = scene;
     MovedThisTick = false;
 }