NAP
Public Member Functions | Public Attributes | List of all members
Rectangle Class Reference

#include <polyline.h>

Public Member Functions

 Rectangle (nap::Core &core)
 
virtual bool init (utility::ErrorState &errorState) override
 
virtual bool isClosed () const override
 
- Public Member Functions inherited from PolyLine
 PolyLine (nap::Core &core)
 
virtual MeshInstancegetMeshInstance () override
 
virtual const MeshInstancegetMeshInstance () const override
 
Vec3VertexAttributegetPositionAttr ()
 
const Vec3VertexAttributegetPositionAttr () const
 
Vec4VertexAttributegetColorAttr ()
 
const Vec4VertexAttributegetColorAttr () const
 
Vec3VertexAttributegetNormalAttr ()
 
const Vec3VertexAttributegetNormalAttr () const
 
Vec3VertexAttributegetUvAttr ()
 
const Vec3VertexAttributegetUvAttr () const
 
template<typename T >
void getValue (const VertexAttribute< T > &attr, float location, T &outValue) const
 
template<typename T >
void getValue (const std::map< float, int > &distanceMap, const VertexAttribute< T > &attr, float location, T &outValue) const
 
void getNormal (const std::map< float, int > &distanceMap, const Vec3VertexAttribute &attr, float location, glm::vec3 &outValue) const
 
float getDistances (std::map< float, int > &outDistances) const
 
- Public Member Functions inherited from Resource
 Resource ()
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
virtual void onDestroy ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Public Attributes

glm::vec2 mDimensions = { 1.0f, 1.0f }
 Property: 'Dimensions' describes the width and height of the rectangle. More...
 
- Public Attributes inherited from PolyLine
PolyLineProperties mLineProperties
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 
- Static Protected Member Functions inherited from PolyLine
static void createVertexAttributes (MeshInstance &instance)
 
- Protected Attributes inherited from PolyLine
std::unique_ptr< MeshInstancemMeshInstance
 
RenderServicemRenderService = nullptr
 

Description

Simple rectangle as a polygon line. Vertex count starts at the lower left corner and evolves counter-clockwise. The uv coordinates are normalized based on the longest edge. The normals are interpolated from the edge vertices and point outwards from the center.

Inheritance diagram for Rectangle:
[legend]
Collaboration diagram for Rectangle:
[legend]

Constructor & Destructor Documentation

◆ Rectangle()

Rectangle ( nap::Core core)

Member Function Documentation

◆ init()

virtual bool init ( utility::ErrorState errorState)
overridevirtual

Creates the rectangle

Returns
if the rectangle was successfully created

Reimplemented from PolyLine.

◆ isClosed()

virtual bool isClosed ( ) const
overridevirtual
Returns
closed

Implements PolyLine.

Member Data Documentation

◆ mDimensions

glm::vec2 mDimensions = { 1.0f, 1.0f }

Property: 'Dimensions' describes the width and height of the rectangle.