public IKBoneChain CreateBoneChain() { var ikbc = new IKBoneChain(); mIKChains.Add(ikbc); return(ikbc); }
private void CreateIKChain(IKSolver ikSolver, Quaternion rot, float scale, Vector3 pos) { ikbc = ikSolver.CreateBoneChain(); var t = 0.15f; ikbc.AddBone(0.2f * scale, Color.Gray, new Vector3(0.0f, 0.5f, 0.0f) + pos, t); for (var i = 0; i < 2; i++) { t *= 0.8f; ikbc.AddBone(0.3f * scale, Color.Gray, null, t); t *= 0.8f; ikbc.AddBone(0.3f * scale, Color.Gray, null, t); } t *= 0.8f; ikbc.AddBone(0.3f * scale, Color.Red, null, t); ikbc.mBones[0].BaseRot = rot; ikbc.DropPos1 = new Vector3(-0.6f, 1.1f, 0.8f); ikbc.DropPos2 = new Vector3(0.6f, 1.1f, 0.8f); var g = Program.Inst.GraphicsDevice; var stoolColor = Color.Red; var stoolTransform = Matrix.CreateScale(0.5f * Vector3.One) * Matrix.CreateTranslation(0.25f * Vector3.Up + pos); var stoolMesh = MeshGen.Disc(0.4f, 1.0f).FlipNormals().Transform(stoolTransform).Color(stoolColor); AddEntity(new EcsEntity(new CAabb { Aabb = stoolMesh.Aabb() }, new CMesh { Mesh = stoolMesh.Gpu(g) })); }