neoGFX
C++ GPU-oriented GUI library and app/game creation framework.
neogfx::sprite Class Reference

#include <sprite.hpp>

Inheritance diagram for neogfx::sprite:
neogfx::i_sprite neogfx::shape neogfx::physical_object neogfx::i_shape neogfx::i_physical_object neogfx::i_shape neogfx::i_physical_object neogfx::i_game_object neogfx::i_mesh neogfx::i_collidable_object neogfx::i_game_object neogfx::i_mesh neogfx::i_collidable_object neogfx::i_game_object neogfx::i_game_object

Public Types

typedef i_physical_object::time_interval time_interval
 
typedef i_physical_object::optional_time_interval optional_time_interval
 
typedef i_physical_object::step_time_interval step_time_interval
 
- Public Types inherited from neogfx::i_sprite
typedef i_physical_object::time_interval time_interval
 
typedef i_physical_object::optional_time_interval optional_time_interval
 
typedef i_physical_object::step_time_interval step_time_interval
 
typedef i_physical_object::optional_step_time_interval optional_step_time_interval
 
- Public Types inherited from neogfx::i_shape
typedef std::size_t frame_index
 
typedef scalar time_interval
 
typedef std::pair< frame_index, time_intervalanimation_frame
 
typedef std::vector< animation_frameanimation_frames
 
typedef boost::optional< time_intervaloptional_time_interval
 
- Public Types inherited from neogfx::i_physical_object
typedef scalar time_interval
 
typedef boost::optional< time_intervaloptional_time_interval
 
typedef int64_t step_time_interval
 
typedef boost::optional< step_time_intervaloptional_step_time_interval
 
- Public Types inherited from neogfx::shape
typedef i_shape::frame_index frame_index
 
typedef i_shape::time_interval time_interval
 
typedef i_shape::animation_frame animation_frame
 
typedef i_shape::animation_frames animation_frames
 
typedef i_shape::time_interval time_interval
 
typedef i_shape::optional_time_interval optional_time_interval
 
typedef boost::optional< animation_infooptional_animation_info
 

Public Member Functions

 sprite ()
 
 sprite (const colour &aColour)
 
 sprite (const i_texture &aTexture, const optional_animation_info &aAnimationInfo=optional_animation_info())
 
 sprite (const i_image &aImage, const optional_animation_info &aAnimationInfo=optional_animation_info())
 
 sprite (const i_texture &aTexture, const rect &aTextureRect, const optional_animation_info &aAnimationInfo=optional_animation_info())
 
 sprite (const i_image &aImage, const rect &aTextureRect, const optional_animation_info &aAnimationInfo=optional_animation_info())
 
 sprite (const sprite &aOther)
 
object_category category () const override
 
const i_shapeas_shape () const override
 
i_shapeas_shape () override
 
const i_collidable_objectas_collidable_object () const override
 
i_collidable_objectas_collidable_object () override
 
const i_physical_objectas_physical_object () const override
 
i_physical_objectas_physical_object () override
 
uint64_t collision_mask () const override
 
void set_collision_mask (uint64_t aMask) override
 
bool killed () const override
 
void kill () override
 
void animation_finished () override
 
vec3 origin () const override
 
vec3 position () const override
 
mat44 transformation_matrix () const override
 
const optional_pathpath () const override
 
void set_origin (const vec3 &aOrigin) override
 
void set_position (const vec3 &aPosition) override
 
void set_path (const optional_path &aPath) override
 
void clear_vertices_cache () override
 
void clear_aabb_cache () override
 
bool update (const optional_time_interval &aNow, const vec3 &aForce) override
 
const optional_time_intervalupdate_time () const override
 
void set_update_time (const optional_time_interval &aLastUpdateTime) override
 
const neogfx::aabbaabb () const override
 
- Public Member Functions inherited from neogfx::i_sprite
virtual ~i_sprite ()
 
- Public Member Functions inherited from neogfx::i_shape
virtual ~i_shape ()
 
void set_origin (const vec2 &aOrigin)
 
void set_origin (const point &aOrigin)
 
void set_position (const vec2 &aPosition)
 
void set_position (const point &aPosition)
 
void set_extents (const vec2 &aExtents)
 
void set_extents (const size &aExtents)
 
- Public Member Functions inherited from neogfx::i_game_object
virtual ~i_game_object ()
 
virtual const object_typetype () const
 
- Public Member Functions inherited from neogfx::i_physical_object
virtual ~i_physical_object ()
 
void set_angle_radians (scalar aAngle)
 
void set_angle_degrees (scalar aAngle)
 
void set_spin_radians (scalar aSpin)
 
void set_spin_degrees (scalar aSpin)
 
- Public Member Functions inherited from neogfx::shape
 shape ()
 
 shape (const colour &aColour)
 
 shape (const i_texture &aTexture, const optional_animation_info &aAnimationInfo=optional_animation_info())
 
 shape (const i_image &aImage, const optional_animation_info &aAnimationInfo=optional_animation_info())
 
 shape (const i_texture &aTexture, const rect &aTextureRect, const optional_animation_info &aAnimationInfo=optional_animation_info())
 
 shape (const i_image &aImage, const rect &aTextureRect, const optional_animation_info &aAnimationInfo=optional_animation_info())
 
 shape (i_shape_container &aContainer)
 
 shape (i_shape_container &aContainer, const colour &aColour)
 
 shape (i_shape_container &aContainer, const i_texture &aTexture, const optional_animation_info &aAnimationInfo=optional_animation_info())
 
 shape (i_shape_container &aContainer, const i_image &aImage, const optional_animation_info &aAnimationInfo=optional_animation_info())
 
 shape (i_shape_container &aContainer, const i_texture &aTexture, const rect &aTextureRect, const optional_animation_info &aAnimationInfo=optional_animation_info())
 
 shape (i_shape_container &aContainer, const i_image &aImage, const rect &aTextureRect, const optional_animation_info &aAnimationInfo=optional_animation_info())
 
 shape (const shape &aOther)
 
vertex_list_pointer vertices () const override
 
texture_list_pointer textures () const override
 
face_list faces () const override
 
face_list active_faces () const override
 
void activate_faces (face_list aActiveFaces) const override
 
const vertex_listtransformed_vertices () const override
 
void set_vertices (vertex_list_pointer aVertices) override
 
void set_textures (texture_list_pointer aTextures) override
 
void set_faces (face_list aFaces) override
 
const i_shape_containercontainer () const override
 
i_shape_containercontainer () override
 
bool is_tag () const override
 
i_shapetag_of () const override
 
void set_tag_of (i_shape &aTagOf, const vec3 &aOffset=vec3{}) override
 
const vec3tag_offset () const override
 
void set_tag_offset (const vec3 &aOffset) override
 
void unset_tag_of () override
 
frame_index frame_count () const override
 
const i_shape_frameshape_frame (frame_index aFrameIndex) const override
 
i_shape_frameshape_frame (frame_index aFrameIndex) override
 
void add_frame (i_shape_frame &aFrame) override
 
void add_frame (std::shared_ptr< i_shape_frame > aFrame) override
 
void replace_frame (frame_index aFrameIndex, i_shape_frame &aFrame) override
 
void replace_frame (frame_index aFrameIndex, std::shared_ptr< i_shape_frame > aFrame) override
 
void remove_frame (frame_index aFrameIndex) override
 
const animation_framesanimation () const override
 
bool repeat_animation () const override
 
const animation_framecurrent_animation_frame () const override
 
bool has_animation_finished () const override
 
frame_index current_frame_index () const override
 
const i_shape_framecurrent_frame () const override
 
i_shape_framecurrent_frame ()
 
vec3 extents () const override
 
rect bounding_box_2d (bool aWithPosition=true) const override
 
void set_animation (const animation_frames &aAnimation) override
 
void set_current_frame (frame_index aFrameIndex) override
 
void clear_extents () override
 
void set_extents (const vec3 &aExtents) override
 
bool has_transformation_matrix () const override
 
void clear_transformation_matrix () override
 
void set_transformation_matrix (const mat33 &aTransformationMatrix) override
 
void set_transformation_matrix (const mat44 &aTransformationMatrix) override
 
bool update (time_interval aNow) override
 
void paint (graphics_context &aGraphicsContext) const override
 
- Public Member Functions inherited from neogfx::physical_object
 physical_object ()
 
 physical_object (const physical_object &aOther)
 
vec3 angle_radians () const override
 
vec3 angle_degrees () const override
 
vec3 velocity () const override
 
vec3 acceleration () const override
 
vec3 spin_radians () const override
 
vec3 spin_degrees () const override
 
scalar mass () const override
 
void set_angle_radians (const vec3 &aAngle) override
 
void set_angle_degrees (const vec3 &aAngle) override
 
void set_velocity (const vec3 &aVelocity) override
 
void set_acceleration (const vec3 &aAcceleration) override
 
void set_spin_radians (const vec3 &aSpin) override
 
void set_spin_degrees (const vec3 &aSpin) override
 
void set_mass (scalar aMass) override
 
const neogfx::aabbsaved_aabb () const override
 
void save_aabb () override
 
void clear_saved_aabb () override
 
bool collidable () const override
 
bool has_collided (const i_collidable_object &aOther) const override
 
void collided (i_collidable_object &aOther) override
 
uint32_t collision_update_id () const override
 
void set_collision_update_id (uint32_t aCollisionUpdateId) override
 

Detailed Description

Definition at line 28 of file sprite.hpp.

Member Typedef Documentation

◆ optional_time_interval

◆ step_time_interval

◆ time_interval

Constructor & Destructor Documentation

◆ sprite() [1/7]

neogfx::sprite::sprite ( )

◆ sprite() [2/7]

neogfx::sprite::sprite ( const colour aColour)

◆ sprite() [3/7]

neogfx::sprite::sprite ( const i_texture aTexture,
const optional_animation_info aAnimationInfo = optional_animation_info() 
)

◆ sprite() [4/7]

neogfx::sprite::sprite ( const i_image aImage,
const optional_animation_info aAnimationInfo = optional_animation_info() 
)

◆ sprite() [5/7]

neogfx::sprite::sprite ( const i_texture aTexture,
const rect aTextureRect,
const optional_animation_info aAnimationInfo = optional_animation_info() 
)

◆ sprite() [6/7]

neogfx::sprite::sprite ( const i_image aImage,
const rect aTextureRect,
const optional_animation_info aAnimationInfo = optional_animation_info() 
)

◆ sprite() [7/7]

neogfx::sprite::sprite ( const sprite aOther)

Member Function Documentation

◆ aabb()

const neogfx::aabb& neogfx::sprite::aabb ( ) const
overridevirtual

Reimplemented from neogfx::physical_object.

◆ animation_finished()

void neogfx::sprite::animation_finished ( )
overridevirtual

Reimplemented from neogfx::shape.

◆ as_collidable_object() [1/2]

const i_collidable_object& neogfx::sprite::as_collidable_object ( ) const
overridevirtual

Reimplemented from neogfx::physical_object.

◆ as_collidable_object() [2/2]

i_collidable_object& neogfx::sprite::as_collidable_object ( )
overridevirtual

Reimplemented from neogfx::physical_object.

◆ as_physical_object() [1/2]

const i_physical_object& neogfx::sprite::as_physical_object ( ) const
overridevirtual

Reimplemented from neogfx::physical_object.

◆ as_physical_object() [2/2]

i_physical_object& neogfx::sprite::as_physical_object ( )
overridevirtual

Reimplemented from neogfx::physical_object.

◆ as_shape() [1/2]

const i_shape& neogfx::sprite::as_shape ( ) const
overridevirtual

Reimplemented from neogfx::physical_object.

◆ as_shape() [2/2]

i_shape& neogfx::sprite::as_shape ( )
overridevirtual

Reimplemented from neogfx::physical_object.

◆ category()

object_category neogfx::sprite::category ( ) const
overridevirtual

Reimplemented from neogfx::physical_object.

◆ clear_aabb_cache()

void neogfx::sprite::clear_aabb_cache ( )
overridevirtual

Reimplemented from neogfx::physical_object.

◆ clear_vertices_cache()

void neogfx::sprite::clear_vertices_cache ( )
overridevirtual

Reimplemented from neogfx::physical_object.

◆ collision_mask()

uint64_t neogfx::sprite::collision_mask ( ) const
overridevirtual

Reimplemented from neogfx::i_collidable_object.

◆ kill()

void neogfx::sprite::kill ( )
overridevirtual

Reimplemented from neogfx::physical_object.

◆ killed()

bool neogfx::sprite::killed ( ) const
overridevirtual

Reimplemented from neogfx::physical_object.

◆ origin()

vec3 neogfx::sprite::origin ( ) const
overridevirtual

Implements neogfx::i_sprite.

◆ path()

const optional_path& neogfx::sprite::path ( ) const
overridevirtual

Implements neogfx::i_sprite.

◆ position()

vec3 neogfx::sprite::position ( ) const
overridevirtual

Implements neogfx::i_sprite.

◆ set_collision_mask()

void neogfx::sprite::set_collision_mask ( uint64_t  aMask)
overridevirtual

Reimplemented from neogfx::i_collidable_object.

◆ set_origin()

void neogfx::sprite::set_origin ( const vec3 aOrigin)
overridevirtual

Implements neogfx::i_sprite.

◆ set_path()

void neogfx::sprite::set_path ( const optional_path aPath)
overridevirtual

Implements neogfx::i_sprite.

◆ set_position()

void neogfx::sprite::set_position ( const vec3 aPosition)
overridevirtual

Implements neogfx::i_sprite.

◆ set_update_time()

void neogfx::sprite::set_update_time ( const optional_time_interval aLastUpdateTime)
overridevirtual

Implements neogfx::i_sprite.

◆ transformation_matrix()

mat44 neogfx::sprite::transformation_matrix ( ) const
overridevirtual

Reimplemented from neogfx::shape.

◆ update()

bool neogfx::sprite::update ( const optional_time_interval aNow,
const vec3 aForce 
)
overridevirtual

Implements neogfx::i_sprite.

◆ update_time()

const optional_time_interval& neogfx::sprite::update_time ( ) const
overridevirtual

Implements neogfx::i_sprite.


The documentation for this class was generated from the following file: