| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- #pragma once
- #include "BsScriptEnginePrerequisites.h"
- #include "BsScriptObject.h"
- #include "BsPhysicsCommon.h"
- namespace BansheeEngine
- {
- /** Interop struct between C++ & CLR for PhysicsQueryHit. */
- struct ScriptPhysicsQueryHit // Must match C# PhysicsQueryHit struct layout
- {
- Vector3 point;
- Vector3 normal;
- Vector2 uv;
- float distance;
- UINT32 triangleIdx;
- MonoObject* collider;
- };
- /** Helper class for dealing with PhysicsQueryHit structure. */
- class BS_SCR_BE_EXPORT ScriptPhysicsQueryHitHelper : public ScriptObject<ScriptPhysicsQueryHitHelper>
- {
- SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "PhysicsQueryHit")
- public:
- /** Converts native physics query hit to its managed counterpart. */
- static ScriptPhysicsQueryHit create(const PhysicsQueryHit& data);
- /** Unboxes a boxed managed ScriptPhysicsQueryHit struct and returns the native version of the structure. */
- static ScriptPhysicsQueryHit unbox(MonoObject* obj);
- /** Boxes a native ScriptPhysicsQueryHit struct and returns a managed object containing it. */
- static MonoObject* box(const ScriptPhysicsQueryHit& value);
- private:
- ScriptPhysicsQueryHitHelper(MonoObject* instance);
- };
- }
|