#pragma once #include #include #include #include "PoseableBatch.h" namespace charcoal { namespace builtin { // This has to be made completely seperately in order to avoid the vtable that gets added if Poseable is abstracted between // 2D and 3D template > class Poseable2DBatch : public PoseableBatch { public: using PoseableBatch::PoseableBatch; Poseable2D& get_pose(int index) { Poseable& pose = PoseableBatch::get_pose(index); Poseable* p_pose = &pose; Poseable2D* p_pose_2d = reinterpret_cast(p_pose); // Can do this since both are just mat4 wrappers return *p_pose_2d; } const Poseable2D& get_pose(int index) const { Poseable& pose = PoseableBatch::get_pose(index); Poseable* p_pose = &pose; Poseable2D* p_pose_2d = reinterpret_cast(p_pose); // Can do this since both are just mat4 wrappers return *p_pose_2d; } }; } }