//--------------------------------------------------------------------------- CREATE / DESTROY public override void OnStart_DefineLimb() { //=== Init Bones and Joints === _aJoints.Add(_oJointExtremity = CJointDriver.Create(this, null, "chestUpper", 15, 8, -000, 000, 000, 000, 1)); //### The body's root bone... is kinematic and has no joint to a parent bone so all zeros _aJoints.Add(_oJointChestLower = CJointDriver.Create(this, _oJointExtremity, "chestLower", 15, 8, -015, 015, 010, 010, 1)); _aJoints.Add(_oJointAbdomenUpper = CJointDriver.Create(this, _oJointChestLower, "abdomenUpper", 15, 6, -035, 025, 012, 020, 1)); _aJoints.Add(_oJointAbdomenLower = CJointDriver.Create(this, _oJointAbdomenUpper, "abdomenLower", 15, 6, -040, 025, 024, 020, 1)); _aJoints.Add(_oJointHip = CJointDriver.Create(this, _oJointAbdomenLower, "hip", 15, 6, -035, 020, 015, 015, 1)); //###NOTE: Pelvis bone is in CActorPelvis for extra processing there. //###CHECK: Keep? _oJointExtremity._oRigidBody.isKinematic = (CGame.INSTANCE._GameMode == EGameModes.Configure); //###HACK ###TEMP ####REVA If play no anim just set everything to kinematic... for temp cloth exploration //###OBS? _oJointExtremity._oRigidBody.isKinematic = false; // We need to disable kinematic on bone as we're driving it with our pin! //=== Init Hotspot === _oHotSpot = CHotSpot.CreateHotspot(this, transform, "Chest", true, new Vector3(0, 0, 0), C_SizeHotSpot_BodyNodes); //_oHotSpot = CHotSpot.CreateHotspot(this, _oBody.FindBone("chestUpper"), "Chest", true, new Vector3(0, 0, 0), C_SizeHotSpot_TorsoNodes); //=== Init CObject === _oObj = new CObject(this, _oBody._oBodyBase._nBodyID, typeof(EActorChest), "Chest", "Chest"); _oObj.PropGroupBegin("", "", true); AddBaseActorProperties(); // The first properties of every CActor subclass are Pinned, pos & rot _oObj.PropAdd(EActorChest.Torso_LeftRight, "Torso_LeftRight", 0, -100, 100, ""); //###BUG: Have to recalibrate to make new abdoment-centric bones look good. _oObj.PropAdd(EActorChest.Torso_UpDown, "Torso_UpDown", 0, -100, 100, ""); //###NOW###: Forced to enter crappy name because of new CProp restrictions with naming! _oObj.PropAdd(EActorChest.Torso_Twist, "Torso_Twist", 0, -100, 100, ""); _oObj.FinishInitialization(); //###PROBLEM: Base actor adds 'pinned' but chest is always pinned? //###CHECK?? _oObj.PropSet(EActorChest.Pinned, 1); // Manually set pinned to 1 on torso so body doesn't float in space when no pose is loaded (Weak that we can't set in PropAdd() due to init-time problems) if (CGame.INSTANCE.EnableIdlePoseMovement) StartCoroutine(Coroutine_ChangeRandomPose()); //###CHECK: When destroyed OK?? }
//--------------------------------------------------------------------------- CREATE / DESTROY public override void OnStart_DefineLimb() { //###CHECK _aJoints.Add(_oJointExtremity = CJointDriver.Create(this, _oBody._oActor_Chest._oJointHip, "sex", 1.0f, 1.0f, -0f, 0, -0f, 0f, -0f, 0f)); _aJoints.Add(_oJointExtremity = CJointDriver.Create(this, _oBody._oActor_Chest._oJointHip, "pelvis", 15, 8, -025, 025, 010, 015, 1)); _oHotSpot = CHotSpot.CreateHotspot(this, transform, "Pelvis", true, new Vector3(0, 0, 0), C_SizeHotSpot_BodyNodes); _oObj = new CObject(this, _oBody._oBodyBase._nBodyID, typeof(EActorPelvis), "Pelvis", "Pelvis"); _oObj.PropGroupBegin("", "", true); AddBaseActorProperties(); // The first properties of every CActor subclass are Pinned, pos & rot _oObj.FinishInitialization(); _oObj.PropSet(EActorPelvis.Pinned, 1); // Manually set pinned to 1 on chest so body doesn't float in space when no pose is loaded (Weak that we can't set in PropAdd() due to init-time problems) }