int UnityEngineTransform_m_TransformPoint(RealStatePtr L, int gen_param_count) { ObjectTranslator translator = this; UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); if (gen_param_count == 4 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4)) { float _x = (float)LuaAPI.lua_tonumber(L, 2); float _y = (float)LuaAPI.lua_tonumber(L, 3); float _z = (float)LuaAPI.lua_tonumber(L, 4); UnityEngine.Vector3 gen_ret = gen_to_be_invoked.TransformPoint(_x, _y, _z); translator.PushUnityEngineVector3(L, gen_ret); return(1); } if (gen_param_count == 2 && translator.Assignable <UnityEngine.Vector3>(L, 2)) { UnityEngine.Vector3 _position; translator.Get(L, 2, out _position); UnityEngine.Vector3 gen_ret = gen_to_be_invoked.TransformPoint(_position); translator.PushUnityEngineVector3(L, gen_ret); return(1); } return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Transform.TransformPoint!")); }
static StackObject *TransformPoint_21(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); UnityEngine.Vector3 @position = new UnityEngine.Vector3(); if (ILRuntime.Runtime.Generated.CLRBindings.s_UnityEngine_Vector3_Binding_Binder != null) { ILRuntime.Runtime.Generated.CLRBindings.s_UnityEngine_Vector3_Binding_Binder.ParseValue(ref @position, __intp, ptr_of_this_method, __mStack, true); } else { @position = (UnityEngine.Vector3) typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); } ptr_of_this_method = ILIntepreter.Minus(__esp, 2); UnityEngine.Transform instance_of_this_method = (UnityEngine.Transform) typeof(UnityEngine.Transform).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.TransformPoint(@position); if (ILRuntime.Runtime.Generated.CLRBindings.s_UnityEngine_Vector3_Binding_Binder != null) { ILRuntime.Runtime.Generated.CLRBindings.s_UnityEngine_Vector3_Binding_Binder.PushValue(ref result_of_this_method, __intp, __ret, __mStack); return(__ret + 1); } else { return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method)); } }
public static int TransformPoint(IntPtr L) { int result = 1; int count = LuaDLL.lua_gettop(L); if (count == 2 && LuaStatic.CheckType(L, typeof(UnityEngine.Vector3), 2)) { UnityEngine.Transform obj = LuaStatic.GetObj(L, 1) as UnityEngine.Transform; UnityEngine.Vector3 arg1 = (UnityEngine.Vector3)LuaStatic.GetObj(L, 2); LuaDLL.lua_pushvector3(L, obj.TransformPoint(arg1)); return(result); } if (count == 4 && LuaStatic.CheckType(L, typeof(Single), 2) && LuaStatic.CheckType(L, typeof(Single), 3) && LuaStatic.CheckType(L, typeof(Single), 4)) { UnityEngine.Transform obj = LuaStatic.GetObj(L, 1) as UnityEngine.Transform; Single arg1 = (Single)(double)(LuaStatic.GetObj(L, 2)); Single arg2 = (Single)(double)(LuaStatic.GetObj(L, 3)); Single arg3 = (Single)(double)(LuaStatic.GetObj(L, 4)); LuaDLL.lua_pushvector3(L, obj.TransformPoint(arg1, arg2, arg3)); return(result); } LuaStatic.traceback(L, "count not enough"); LuaDLL.lua_error(L); return(result); }
static int _m_TransformPoint(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.Transform __cl_gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); int __gen_param_count = LuaAPI.lua_gettop(L); try { if (__gen_param_count == 4 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4)) { float x = (float)LuaAPI.lua_tonumber(L, 2); float y = (float)LuaAPI.lua_tonumber(L, 3); float z = (float)LuaAPI.lua_tonumber(L, 4); UnityEngine.Vector3 __cl_gen_ret = __cl_gen_to_be_invoked.TransformPoint(x, y, z); translator.PushUnityEngineVector3(L, __cl_gen_ret); return(1); } if (__gen_param_count == 2 && translator.Assignable <UnityEngine.Vector3>(L, 2)) { UnityEngine.Vector3 position; translator.Get(L, 2, out position); UnityEngine.Vector3 __cl_gen_ret = __cl_gen_to_be_invoked.TransformPoint(position); translator.PushUnityEngineVector3(L, __cl_gen_ret); return(1); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Transform.TransformPoint!")); }
public ImpactInfo TrackImpact(TableConfig.Skill cfg, int seq, int curObjId, int srcObjId, int targetId, string emitBone, int emitImpact, UnityEngine.Vector3 offset, bool isFinal, Dictionary <string, object> args) { EntityViewModel view = GetEntityViewById(targetId); EntityViewModel srcView = GetEntityViewById(srcObjId); if (null != view && null != view.Entity && null != view.Actor && !view.Entity.IsDeadSkillCasting()) { EntityInfo npc = view.Entity; if (null != cfg) { ImpactInfo impactInfo = null; if (emitImpact <= 0 || emitImpact >= SkillInstance.c_FirstInnerEmitSkillId) { impactInfo = new ImpactInfo(PredefinedSkill.Instance.EmitSkillCfg); } else { impactInfo = new ImpactInfo(emitImpact); } if (TryInitImpactInfo(impactInfo, cfg, seq, curObjId, srcObjId, args)) { UnityEngine.GameObject srcObj = GetGameObject(srcObjId); if (null != srcObj) { UnityEngine.Transform t = Utility.FindChildRecursive(srcObj.transform, emitBone); if (null != t) { UnityEngine.Vector3 pos = t.TransformPoint(offset); impactInfo.SenderPosition = new ScriptRuntime.Vector3(pos.x, pos.y, pos.z); } else { UnityEngine.Vector3 pos = srcObj.transform.TransformPoint(offset); pos.y += npc.GetRadius(); impactInfo.SenderPosition = new ScriptRuntime.Vector3(pos.x, pos.y, pos.z); } } impactInfo.DamageData.IsFinal = isFinal; npc.GetSkillStateInfo().AddImpact(impactInfo); GfxSkillSystem.Instance.StartSkill(targetId, impactInfo.ConfigData, impactInfo.Seq, args); return(impactInfo); } } } return(null); }
public static int TransformPoint(System.IntPtr L) { int nargs = LuaAPI.GetTop(L); if (nargs == 2 && LuaAPI.IsObject(L, 1) && LuaAPI.IsVector3(L, 2)) { UnityEngine.Transform arg0 = (UnityEngine.Transform)LuaCallback.ToObject(L, 1); UnityEngine.Vector3 arg1 = (UnityEngine.Vector3)LuaCallback.ToVector3(L, 2); UnityEngine.Vector3 res = arg0.TransformPoint(arg1); LuaCallback.PushVector(L, res); return(1); } if (nargs == 4 && LuaAPI.IsObject(L, 1) && LuaAPI.IsNumber(L, 2) && LuaAPI.IsNumber(L, 3) && LuaAPI.IsNumber(L, 4)) { UnityEngine.Transform arg0 = (UnityEngine.Transform)LuaCallback.ToObject(L, 1); System.Single arg1 = (System.Single)LuaCallback.ToNumber(L, 2); System.Single arg2 = (System.Single)LuaCallback.ToNumber(L, 3); System.Single arg3 = (System.Single)LuaCallback.ToNumber(L, 4); UnityEngine.Vector3 res = arg0.TransformPoint(arg1, arg2, arg3); LuaCallback.PushVector(L, res); return(1); } return(0); }
/// <param name="targets">没用的</param> public List <ServerNPC> Select(ServerNPC caster, List <ServerNPC> targets, EffectConfigData efCfg, WarServerNpcMgr npcMgr) { #if DEBUG Utils.Assert(caster == null, "Can't find target unless caster isn't null."); Utils.Assert(efCfg == null, "Can't find target unless EffectConfigData isn't null."); Utils.Assert(npcMgr == null, "Can't find target unless WarServerNpcMgr isn't null."); #endif //转换为Camp类型,还有一部分的检查不在这里 //剔除自己的是在Factory里面(即EffectAreaSector) CAMP camp = efCfg.Flags.switchTo(caster.Camp); UTran trans = caster.transform; float Y = trans.localPosition.y; float halfWidth = efCfg.eParam2 * 0.5F + caster.data.configData.radius; float Height = efCfg.eParam1 + caster.data.configData.radius; UVec3[] localVecs = new UVec3[4]; localVecs[0] = new UVec3(-halfWidth, Y, 0f); localVecs[1] = new UVec3(-halfWidth, Y, Height); localVecs[2] = new UVec3(halfWidth, Y, Height); localVecs[3] = new UVec3(halfWidth, Y, 0f); UVec3[] WorldVecs = new UVec3[4]; WorldVecs[0] = trans.TransformPoint(localVecs[0]); WorldVecs[1] = trans.TransformPoint(localVecs[1]); WorldVecs[2] = trans.TransformPoint(localVecs[2]); WorldVecs[3] = trans.TransformPoint(localVecs[3]); //caster.transform.forward; PointF[] vecs = new PointF[4]; vecs[0] = new PointF() { X = WorldVecs[0].x, Y = WorldVecs[0].z, }; vecs[1] = new PointF() { X = WorldVecs[1].x, Y = WorldVecs[1].z, }; vecs[2] = new PointF() { X = WorldVecs[2].x, Y = WorldVecs[2].z, }; vecs[3] = new PointF() { X = WorldVecs[3].x, Y = WorldVecs[3].z, }; Polygon rectangle = new Polygon(vecs); List <ServerNPC> TargetList = SelectorTools.GetNPCPolygon(rectangle, camp, npcMgr).ToList(); return(TargetList); }
public static void Register() { if (doNotModify) { return; } object o = null; { UnityEngine.MonoBehaviour v = (UnityEngine.MonoBehaviour)o; v = new UnityEngine.MonoBehaviour(); var p1 = v.tag; v.tag = (System.String)o; var p2 = v.name; v.name = (System.String)o; v.IsInvoking(); v.CancelInvoke(); v.Invoke((System.String)o, (System.Single)o); v.InvokeRepeating((System.String)o, (System.Single)o, (System.Single)o); v.CancelInvoke((System.String)o); v.IsInvoking((System.String)o); v.StartCoroutine((System.String)o); v.StartCoroutine((System.String)o, (System.Object)o); v.StartCoroutine((System.Collections.IEnumerator)o); v.StopCoroutine((System.Collections.IEnumerator)o); v.StopCoroutine((UnityEngine.Coroutine)o); UnityEngine.MonoBehaviour.print((System.Object)o); v.GetComponent((System.Type)o); UnityEngine.Component p3 = (UnityEngine.Component)o; v.TryGetComponent((System.Type)o, out p3); v.GetComponentInChildren((System.Type)o, (System.Boolean)o); v.GetComponentInChildren((System.Type)o); v.GetComponentsInChildren((System.Type)o, (System.Boolean)o); v.GetComponentsInChildren((System.Type)o); v.GetComponentInParent((System.Type)o); v.GetComponentsInParent((System.Type)o, (System.Boolean)o); v.GetComponentsInParent((System.Type)o); v.GetComponents((System.Type)o); v.GetComponents((System.Type)o, (System.Collections.Generic.List <UnityEngine.Component>)o); v.CompareTag((System.String)o); v.SendMessageUpwards((System.String)o, (System.Object)o); v.SendMessageUpwards((System.String)o); v.SendMessageUpwards((System.String)o, (UnityEngine.SendMessageOptions)o); v.SendMessage((System.String)o, (System.Object)o); v.SendMessage((System.String)o); v.SendMessage((System.String)o, (UnityEngine.SendMessageOptions)o); v.BroadcastMessage((System.String)o, (System.Object)o); v.BroadcastMessage((System.String)o); v.BroadcastMessage((System.String)o, (UnityEngine.SendMessageOptions)o); v.GetInstanceID(); v.GetHashCode(); v.Equals((System.Object)o); v.ToString(); } { UnityEngine.Transform v = (UnityEngine.Transform)o; var p4 = v.position; v.position = (UnityEngine.Vector3)o; var p5 = v.localPosition; v.localPosition = (UnityEngine.Vector3)o; var p6 = v.eulerAngles; v.eulerAngles = (UnityEngine.Vector3)o; var p7 = v.localEulerAngles; v.localEulerAngles = (UnityEngine.Vector3)o; var p8 = v.right; v.right = (UnityEngine.Vector3)o; var p9 = v.up; v.up = (UnityEngine.Vector3)o; var pA = v.forward; v.forward = (UnityEngine.Vector3)o; var pB = v.rotation; v.rotation = (UnityEngine.Quaternion)o; var pC = v.localRotation; v.localRotation = (UnityEngine.Quaternion)o; var pD = v.localScale; v.localScale = (UnityEngine.Vector3)o; var pE = v.parent; v.parent = (UnityEngine.Transform)o; var pF = v.worldToLocalMatrix; var p10 = v.localToWorldMatrix; var p11 = v.root; var p12 = v.lossyScale; var p13 = v.hierarchyCapacity; v.hierarchyCapacity = (System.Int32)o; var p14 = v.hierarchyCount; var p15 = v.tag; v.tag = (System.String)o; var p16 = v.name; v.name = (System.String)o; v.SetParent((UnityEngine.Transform)o); v.SetPositionAndRotation((UnityEngine.Vector3)o, (UnityEngine.Quaternion)o); v.Translate((UnityEngine.Vector3)o, (UnityEngine.Space)o); v.Translate((UnityEngine.Vector3)o); v.Translate((System.Single)o, (System.Single)o, (System.Single)o, (UnityEngine.Space)o); v.Translate((System.Single)o, (System.Single)o, (System.Single)o); v.Translate((UnityEngine.Vector3)o, (UnityEngine.Transform)o); v.Translate((System.Single)o, (System.Single)o, (System.Single)o, (UnityEngine.Transform)o); v.Rotate((UnityEngine.Vector3)o, (UnityEngine.Space)o); v.Rotate((UnityEngine.Vector3)o); v.Rotate((System.Single)o, (System.Single)o, (System.Single)o, (UnityEngine.Space)o); v.Rotate((System.Single)o, (System.Single)o, (System.Single)o); v.Rotate((UnityEngine.Vector3)o, (System.Single)o, (UnityEngine.Space)o); v.Rotate((UnityEngine.Vector3)o, (System.Single)o); v.RotateAround((UnityEngine.Vector3)o, (UnityEngine.Vector3)o, (System.Single)o); v.LookAt((UnityEngine.Transform)o, (UnityEngine.Vector3)o); v.LookAt((UnityEngine.Transform)o); v.LookAt((UnityEngine.Vector3)o, (UnityEngine.Vector3)o); v.LookAt((UnityEngine.Vector3)o); v.TransformDirection((UnityEngine.Vector3)o); v.TransformDirection((System.Single)o, (System.Single)o, (System.Single)o); v.InverseTransformDirection((UnityEngine.Vector3)o); v.InverseTransformDirection((System.Single)o, (System.Single)o, (System.Single)o); v.TransformVector((UnityEngine.Vector3)o); v.TransformVector((System.Single)o, (System.Single)o, (System.Single)o); v.InverseTransformVector((UnityEngine.Vector3)o); v.InverseTransformVector((System.Single)o, (System.Single)o, (System.Single)o); v.TransformPoint((UnityEngine.Vector3)o); v.TransformPoint((System.Single)o, (System.Single)o, (System.Single)o); v.InverseTransformPoint((UnityEngine.Vector3)o); v.InverseTransformPoint((System.Single)o, (System.Single)o, (System.Single)o); v.Find((System.String)o); v.GetEnumerator(); v.GetComponent((System.Type)o); UnityEngine.Component p17 = (UnityEngine.Component)o; v.TryGetComponent((System.Type)o, out p17); v.GetComponentInChildren((System.Type)o, (System.Boolean)o); v.GetComponentInChildren((System.Type)o); v.GetComponentsInChildren((System.Type)o, (System.Boolean)o); v.GetComponentsInChildren((System.Type)o); v.GetComponentInParent((System.Type)o); v.GetComponentsInParent((System.Type)o, (System.Boolean)o); v.GetComponentsInParent((System.Type)o); v.GetComponents((System.Type)o); v.GetComponents((System.Type)o, (System.Collections.Generic.List <UnityEngine.Component>)o); v.CompareTag((System.String)o); v.SendMessageUpwards((System.String)o, (System.Object)o); v.SendMessageUpwards((System.String)o); v.SendMessageUpwards((System.String)o, (UnityEngine.SendMessageOptions)o); v.SendMessage((System.String)o, (System.Object)o); v.SendMessage((System.String)o); v.SendMessage((System.String)o, (UnityEngine.SendMessageOptions)o); v.BroadcastMessage((System.String)o, (System.Object)o); v.BroadcastMessage((System.String)o); v.BroadcastMessage((System.String)o, (UnityEngine.SendMessageOptions)o); v.GetInstanceID(); v.GetHashCode(); v.Equals((System.Object)o); v.ToString(); } }
private static void SetGeometryFromMesh( UnityEngine.Mesh mesh, AK.Wwise.AcousticTexture[] acousticTextures, float[] occlusionValues, UnityEngine.Transform transform, ulong geometryID, ulong associatedRoomID, bool enableDiffraction, bool enableDiffractionOnBoundaryEdges, string name = "") { var vertices = mesh.vertices; // Remove duplicate vertices var vertRemap = new int[vertices.Length]; var uniqueVerts = new System.Collections.Generic.List <UnityEngine.Vector3>(); var vertDict = new System.Collections.Generic.Dictionary <UnityEngine.Vector3, int>(); for (var v = 0; v < vertices.Length; ++v) { int vertIdx = 0; if (!vertDict.TryGetValue(vertices[v], out vertIdx)) { vertIdx = uniqueVerts.Count; uniqueVerts.Add(vertices[v]); vertDict.Add(vertices[v], vertIdx); } vertRemap[v] = vertIdx; } int vertexCount = uniqueVerts.Count; var vertexArray = new UnityEngine.Vector3[vertexCount]; for (var v = 0; v < vertexCount; ++v) { var point = transform.TransformPoint(uniqueVerts[v]); vertexArray[v].x = point.x; vertexArray[v].y = point.y; vertexArray[v].z = point.z; } int surfaceCount = mesh.subMeshCount; var numTriangles = mesh.triangles.Length / 3; if ((mesh.triangles.Length % 3) != 0) { UnityEngine.Debug.LogFormat("SetGeometryFromMesh({0}): Wrong number of triangles", mesh.name); } using (var surfaceArray = new AkAcousticSurfaceArray(surfaceCount)) using (var triangleArray = new AkTriangleArray(numTriangles)) { int triangleArrayIdx = 0; for (var s = 0; s < surfaceCount; ++s) { var surface = surfaceArray[s]; var triangles = mesh.GetTriangles(s); var triangleCount = triangles.Length / 3; if ((triangles.Length % 3) != 0) { UnityEngine.Debug.LogFormat("SetGeometryFromMesh({0}): Wrong number of triangles in submesh {1}", mesh.name, s); } AK.Wwise.AcousticTexture acousticTexture = null; float occlusionValue = 1.0f; if (s < acousticTextures.Length) { acousticTexture = acousticTextures[s]; } if (s < occlusionValues.Length) { occlusionValue = occlusionValues[s]; } surface.textureID = acousticTexture == null ? AK.Wwise.AcousticTexture.InvalidId : acousticTexture.Id; surface.occlusion = occlusionValue; surface.strName = name + "_" + mesh.name + "_" + s; for (var i = 0; i < triangleCount; ++i) { var triangle = triangleArray[triangleArrayIdx]; triangle.point0 = (ushort)vertRemap[triangles[3 * i + 0]]; triangle.point1 = (ushort)vertRemap[triangles[3 * i + 1]]; triangle.point2 = (ushort)vertRemap[triangles[3 * i + 2]]; triangle.surface = (ushort)s; if (triangle.point0 != triangle.point1 && triangle.point0 != triangle.point2 && triangle.point1 != triangle.point2) { ++triangleArrayIdx; } else { UnityEngine.Debug.LogFormat("SetGeometryFromMesh({0}): Skipped degenerate triangle({1}, {2}, {3}) in submesh {4}", mesh.name, 3 * i + 0, 3 * i + 1, 3 * i + 2, s); } } } if (triangleArrayIdx > 0) { AkSoundEngine.SetGeometry( geometryID, triangleArray, (uint)triangleArrayIdx, vertexArray, (uint)vertexArray.Length, surfaceArray, (uint)surfaceArray.Count(), associatedRoomID, enableDiffraction, enableDiffractionOnBoundaryEdges); } else { UnityEngine.Debug.LogFormat("SetGeometry({0}): No valid triangle was found. Geometry was not set", mesh.name); } } }
public void FixedUpdate(UnityEngine.Transform rootTransform) { // - physics rigid body management // -set transforms/velocities for key framed bodies // get all the prediction time infos in this struct PredictionTimeParameters timeInfo = new PredictionTimeParameters(UnityEngine.Time.fixedDeltaTime); // start the predictor _predictor.StartBodyPredicitonForNextFrame(); int index = 0; MultiSourceCombinedSnapshot snapshot = _snapshotManager.GetNextSnapshot(timeInfo.DT); foreach (var rb in _rigidBodies.Values) { // if the body is owned then we only set the kinematic flag for the physics if (rb.Ownership) { if (rb.IsKeyframed) { rb.RigidBody.isKinematic = true; } else { rb.RigidBody.isKinematic = false; } continue; } // Find corresponding rigid body info. // since both are sorted list this should hit without index=0 at the beginning while (index < snapshot.RigidBodies.Count && rb.Id.CompareTo(snapshot.RigidBodies.Values[index].Id) > 0) { index++; } if (index < snapshot.RigidBodies.Count && rb.Id == snapshot.RigidBodies.Values[index].Id) { // todo: kick-in prediction if we are missing an update for this rigid body //if (!snapshot.RigidBodies.Values[index].HasUpdate) //{ // rb.RigidBody.isKinematic = false; // continue; //} RigidBodyTransform transform = snapshot.RigidBodies.Values[index].Transform; float timeOfSnapshot = snapshot.RigidBodies.Values[index].LocalTime; // get the key framed stream, and compute implicit velocities UnityEngine.Vector3 keyFramedPos = rootTransform.TransformPoint(transform.Position); UnityEngine.Quaternion keyFramedOrientation = rootTransform.rotation * transform.Rotation; // if there is a really new update then also store the implicit velocity if (rb.lastTimeKeyFramedUpdate < timeOfSnapshot) { // <todo> for long running times this could be a problem float invUpdateDT = 1.0f / (timeOfSnapshot - rb.lastTimeKeyFramedUpdate); rb.lastValidLinerVelocity = (keyFramedPos - rb.RigidBody.transform.position) * invUpdateDT; // transform to radians and take the angular velocity UnityEngine.Vector3 eulerAngles = ( UnityEngine.Quaternion.Inverse(rb.RigidBody.transform.rotation) * keyFramedOrientation).eulerAngles; UnityEngine.Vector3 radianAngles = UtilMethods.TransformEulerAnglesToRadians(eulerAngles); rb.lastValidAngularVelocity = radianAngles * invUpdateDT; #if MRE_PHYSICS_DEBUG Debug.Log(" Remote body: " + rb.Id.ToString() + " got update lin vel:" + rb.lastValidLinerVelocity + " ang vel:" + rb.lastValidAngularVelocity //+ " DangE:" + eulerAngles + " DangR:" + radianAngles + " time:" + timeOfSnapshot + " newp:" + keyFramedPos + " newR:" + keyFramedOrientation + " incUpdateDt:" + invUpdateDT + " oldP:" + rb.RigidBody.transform.position + " oldR:" + rb.RigidBody.transform.rotation + " OriginalRot:" + transform.Rotation + " keyF:" + rb.RigidBody.isKinematic + " KF:" + rb.IsKeyframed); #endif } rb.lastTimeKeyFramedUpdate = timeOfSnapshot; rb.IsKeyframed = (snapshot.RigidBodies.Values[index].motionType == Patching.Types.MotionType.Keyframed); // code to disable prediction and to use just key framing //rb.RigidBody.isKinematic = true; //rb.RigidBody.transform.position = keyFramedPos; //rb.RigidBody.transform.rotation = keyFramedOrientation; //rb.RigidBody.velocity.Set(0.0f, 0.0f, 0.0f); //rb.RigidBody.angularVelocity.Set(0.0f, 0.0f, 0.0f); // call the predictor with this remotely owned body _predictor.AddAndProcessRemoteBodyForPrediction(rb, transform, keyFramedPos, keyFramedOrientation, timeOfSnapshot, timeInfo); } } // call the predictor _predictor.PredictAllRemoteBodiesWithOwnedBodies(ref _rigidBodies, timeInfo); }