/// <summary>Changes the state of each effector to unactive.</summary> /// <remarks>Changes the state of each effector to unactive. The effect results in non animated bodyparts. /// </remarks> /// <param name="parents">indicates whether parents of the effectors have to be deactivated or not. /// </param> public virtual void deactivateEffectors(bool parents) { foreach (System.Collections.Generic.KeyValuePair <com.brashmonkey.spriter.objects.SpriterIKObject , com.brashmonkey.spriter.objects.SpriterAbstractObject> entry in this.ikMap.EntrySet()) { com.brashmonkey.spriter.objects.SpriterAbstractObject obj = entry.Value; if (entry.Value is com.brashmonkey.spriter.objects.SpriterBone) { obj = this.tempBones[entry.Value.getId()]; } else { obj = this.tempObjects[entry.Value.getId()]; } obj.tween = false; if (!parents) { continue; } com.brashmonkey.spriter.objects.SpriterBone par = (com.brashmonkey.spriter.objects.SpriterBone )entry.Value.getParent(); for (int j = 0; j < entry.Key.chainLength && par != null; j++) { this.tempBones[par.getId()].tween = false; par = (com.brashmonkey.spriter.objects.SpriterBone)par.getParent(); } } }
protected internal override void updateBone(com.brashmonkey.spriter.objects.SpriterBone bone) { base.updateBone(bone); bone.copyValuesTo(temp); com.brashmonkey.spriter.objects.SpriterAbstractObject parent = (bone.hasParent()) ? getRuntimeBones()[bone.getParent().getId()] : this.tempParent; com.brashmonkey.spriter.SpriterCalculator.reTranslateRelative(parent, temp); temp.copyValuesTo(this.lastFrame.getBones()[temp.getId()]); }
public SpriterPlayerIK(com.discobeard.spriter.dom.SpriterData data, com.discobeard.spriter.dom.Entity entity, com.brashmonkey.spriter.file.FileLoader loader) : base(data, entity , loader) { this.resovling = true; this.tolerance = 0.5f; this.resolver = new com.brashmonkey.spriter.player.SpriterCCDResolver(this); base.step(0, 0); this.updateObjects = false; this.ikMap = new System.Collections.Generic.Dictionary <com.brashmonkey.spriter.objects.SpriterIKObject , com.brashmonkey.spriter.objects.SpriterAbstractObject>(); this.temp = new com.brashmonkey.spriter.objects.SpriterBone(); }
public SpriterPlayerIK(com.discobeard.spriter.dom.SpriterData data, com.discobeard.spriter.dom.Entity entity, com.brashmonkey.spriter.file.FileLoader loader) : base(data, entity , loader) { this.resovling = true; this.tolerance = 0.5f; this.resolver = new com.brashmonkey.spriter.player.SpriterCCDResolver(this); base.step(0, 0); this.updateObjects = false; this.ikMap = new System.Collections.Generic.Dictionary<com.brashmonkey.spriter.objects.SpriterIKObject , com.brashmonkey.spriter.objects.SpriterAbstractObject>(); this.temp = new com.brashmonkey.spriter.objects.SpriterBone(); }
/// <summary>Adds the given object to the internal SpriterIKObject - SpriterBone map, which works like a HashMap. /// </summary> /// <remarks> /// Adds the given object to the internal SpriterIKObject - SpriterBone map, which works like a HashMap. /// This means, the values of the given object affect the mapped bone. /// </remarks> /// <param name="object"></param> /// <param name="bone"></param> public virtual void mapIKObject(com.brashmonkey.spriter.objects.SpriterIKObject @object , com.brashmonkey.spriter.objects.SpriterAbstractObject abstractObject) { this.ikMap.Add(@object, abstractObject); }