Skip to content

Instantly share code, notes, and snippets.

@aras-p
Created March 6, 2013 14:36
Show Gist options
  • Select an option

  • Save aras-p/5099699 to your computer and use it in GitHub Desktop.

Select an option

Save aras-p/5099699 to your computer and use it in GitHub Desktop.
in .txt file:
STRUCT ParticleCollisionEvent
CSRAW
private Vector3 m_Intersection;
private Vector3 m_Normal;
private Vector3 m_Velocity;
private GameObject m_GameObject;
// ...
END
somewhere in C++ file, a struct matching memory layout:
struct MonoParticleCollisionEvent {
Vector3 intersection;
Vector3 normal;
Vector3 velocity;
ScriptingObjectPtr gameObject;
};
This struct is _only_ used in implementation of GetParticleCollisionEvents script API.
int ParticleSystem::GetParticleCollisionsExternal (int instanceId, MonoParticleCollisionEvent* collisionEvents, int size) const
{
// now here, fill in the destination array, with the game object pointer etc., using ObjectToScriptingObject
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment