tec::manipulator::Placement

Manipulator used to place objects in the world. Can have a mesh assigned to provide visual feedback.

#include <placement.hpp>

Public Functions

Name
void SetMaxDistance(float _max_distance =DEFAULT_MAX_PLACEMENT_DISTANCE)
void SetMesh(const std::shared_ptr< MeshFile > _mesh)
Set the mesh used to represent the placement in the world.
void SetMesh(const std::string mesh_name)
Set the mesh used to represent the placement in the world.
void ClearMesh()
Clear the mesh, effectively not longer rendering the placement.
void SetRayIntersectionPoint(const glm::vec3 start, const glm::vec3 intersection)
Sets the ray used to render the placement.
void PlaceEntityInWorld(glm::vec3 _position)
void RegisterLuaType(sol::state & )

Public Functions Documentation

function SetMaxDistance

void SetMaxDistance(
    float _max_distance =DEFAULT_MAX_PLACEMENT_DISTANCE
)

function SetMesh

void SetMesh(
    const std::shared_ptr< MeshFile > _mesh
)

Set the mesh used to represent the placement in the world.

Parameters:

  • const std::shared_ptr mesh MeshFile to render in the world.

function SetMesh

void SetMesh(
    const std::string mesh_name
)

Set the mesh used to represent the placement in the world.

Parameters:

  • const std::string mesh_name Name of the mesh file to load.

This version takes the mesh_name and locators the corresponding mesh_file and then calls the appropriate SetMesh;

function ClearMesh

void ClearMesh()

Clear the mesh, effectively not longer rendering the placement.

function SetRayIntersectionPoint

void SetRayIntersectionPoint(
    const glm::vec3 start,
    const glm::vec3 intersection
)

Sets the ray used to render the placement.

Parameters:

  • const glm::vec3 start Starting point for the ray, usually the center of the screen.
  • const glm::vec3 intersection Intersection point of the ray with the physics world.

Sets the position in the world of the placement mesh based on the ray's start point and going to either the intersection point or the point along the ray that is MAX_DISTANCE towards the intersection point.

function PlaceEntityInWorld

void PlaceEntityInWorld(
    glm::vec3 _position
)

function RegisterLuaType

static void RegisterLuaType(
    sol::state & 
)

Updated on 2022-07-24 at 19:27:35 +0000