Moderators: Sascha Willems, walaber
dNewtonCollision BuildCollision(List<NewtonPlugin.NewtonCollider> colliders)
s(45,49,45,82): error CS0246: The type or namespace name 'List<NewtonPlugin.NewtonCollider>' could not be found (are you missing a using directive or an assembly reference?)
dNewtonCollision BuildCollision(NewtonCollider[] colliders)
using System.Collections.Generic
public void Init()
{
// get the list of all collision components associated with the body
List<NewtonCollider> colliders = new List<NewtonCollider>();
TraverseColliders(gameObject, colliders);
// generate the collision shape
dNewtonCollision collision = m_world.BuildCollision(colliders);
// create the body
Matrix4x4 matrix = Matrix4x4.identity;
matrix.SetTRS(transform.position, transform.rotation, Vector3.one);
// here I can't get the address of the matrix array of floats
m_body = new dNewtonDynamicBody(m_world.GetWorld(), collision, &matrix.m00, GCHandle.ToIntPtr(m_pinThisObject));
}
// Initialize unmanged memory to hold the struct.
IntPtr pnt = Marshal.AllocHGlobal(Marshal.SizeOf(matrix));
// Copy the struct to unmanaged memory.
Marshal.StructureToPtr(matrix, pnt, false);
m_body = new dNewtonDynamicBody(m_world.GetWorld(), collision, pnt, GCHandle.ToIntPtr(m_pinThisObject));
// Free the unmanaged memory.
Marshal.FreeHGlobal(pnt);
//dNewtonDynamicBody(dNewtonWorld* const world, const dNewtonCollision* const collision, const void* const matrix, void* const userData);
dNewtonDynamicBody(dNewtonWorld* const world, const dNewtonCollision* const collision, const void* const matrix, void* const userData);
Your MonoBehaviour won't have a checkbox next to it in the inspector if it doesn't have any of the per-frame methods, like Update, FixedUpdate, OnGUI, etc.
Users browsing this forum: No registered users and 5 guests