public void Start() { pullBlendshapes.Clear(); pushBlendshapes.Clear(); expandBlendshapes.Clear(); for (int i = 0; i < holeMeshes.Count; i++) { pullBlendshapes.Add(holeMeshes[i].sharedMesh.GetBlendShapeIndex(pullBlendshapeName)); pushBlendshapes.Add(holeMeshes[i].sharedMesh.GetBlendShapeIndex(pushBlendshapeName)); expandBlendshapes.Add(holeMeshes[i].sharedMesh.GetBlendShapeIndex(expandBlendshapeName)); } physicsJoint = body.gameObject.AddComponent <AxisJoint>(); physicsJoint.body = body; physicsJoint.weight = 0f; worldUpObject = new GameObject(holeTransform.name + "WorldUpAxis"); worldUpObject.transform.parent = holeTransform.parent; worldUpObject.transform.position = holeTransform.position + holeTransform.TransformDirection(holeUpAxis); if (dickTarget && dickTarget.dickTransform) { physicsJoint.connectedBody = dickTarget.body; physicsJoint.localConnectedAxis = physicsJoint.connectedBody.transform.InverseTransformDirection(dickTarget.dickTransform.TransformDirection(dickTarget.dickForwardAxis)); physicsJoint.localConnectedAnchor = physicsJoint.connectedBody.transform.InverseTransformPoint(dickTarget.dickTransform.position); physicsJoint.weight = 1f; } // The fake hole is so that dicks aim properly. //realHoleTransform = holeTransform; fakeHoleGameObject = new GameObject(holeTransform.name + "(Copy)"); fakeHoleGameObject.transform.parent = holeTransform.parent; fakeHoleGameObject.transform.localPosition = holeTransform.localPosition; fakeHoleGameObject.transform.localRotation = holeTransform.localRotation; physicsJoint.localAnchor = body.transform.InverseTransformPoint(fakeHoleGameObject.transform.position); physicsJoint.localForwardAxis = physicsJoint.body.transform.InverseTransformDirection(fakeHoleGameObject.transform.TransformDirection(holeForwardAxis)); //holeTransform = fakeHoleGameObject.transform; }
void Start() { Transform t = this.transform; for (int i = 0; i < this.chain; ++i) { t = t.parent; this.rotations.Add(t.localRotation); AxisJoint j = t.GetComponent <AxisJoint>(); if (j != null) { this.axiss.Add(j.axis); } else { this.axiss.Add(Axis.ALL); } } }
public void Connect(string strName, out AxisJoint item) { ExAddProperty(this.m_pSelf, strName, 4, 0x5208); item = null; }
public void Connect(string strName, out AxisJoint item) { item = RuntimeObject.FromPtr(ExGetProperty(this.m_pSelf, strName, 4, 0x5208)) as AxisJoint; }