Panda3D
Public Member Functions | Public Attributes | List of all members
GeomVertexAnimationSpec Class Reference

This object describes how the vertex animation, if any, represented in a GeomVertexData is encoded. More...

#include "geomVertexAnimationSpec.h"

Inheritance diagram for GeomVertexAnimationSpec:
GeomEnums

Public Member Functions

 GeomVertexAnimationSpec (const GeomVertexAnimationSpec &other)
 
int compare_to (const GeomVertexAnimationSpec &other) const
 Provides an arbitrary ordering between different animation specs. More...
 
void fillin (DatagramIterator &scan, BamReader *manager)
 This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new GeomVertexAnimationSpec. More...
 
AnimationType get_animation_type () const
 
bool get_indexed_transforms () const
 
int get_num_transforms () const
 
bool operator != (const GeomVertexAnimationSpec &other) const
 
bool operator< (const GeomVertexAnimationSpec &other) const
 Provides an arbitrary ordering between different animation specs. More...
 
void operator= (const GeomVertexAnimationSpec &other)
 
bool operator== (const GeomVertexAnimationSpec &other) const
 
void output (std::ostream &out) const
 
void set_hardware (int num_transforms, bool indexed_transforms)
 Specifies that vertex animation is to be performed by the graphics hardware (or at least by the graphics backend API, which is actually still free to animate the vertices on the CPU). More...
 
void set_none ()
 Specifies that no vertex animation is represented by this spec. More...
 
void set_panda ()
 Specifies that vertex animation is to be performed by Panda. More...
 
void write_datagram (BamWriter *manager, Datagram &dg)
 Writes the contents of this object to the datagram for shipping out to a Bam file. More...
 

Public Attributes

 get_animation_type
 Returns the type of animation represented by this spec. More...
 
 get_indexed_transforms
 This is only meaningful for animation_type AT_hardware. More...
 
 get_num_transforms
 This is only meaningful for animation_type AT_hardware. More...
 

Additional Inherited Members

- Public Types inherited from GeomEnums
enum  AnimationType { AT_none, AT_panda, AT_hardware }
 
enum  Contents {
  C_other, C_point, C_clip_point, C_vector,
  C_texcoord, C_color, C_index, C_morph_delta,
  C_matrix, C_normal
}
 
enum  GeomRendering {
  GR_indexed_point = 0x00001, GR_indexed_other = 0x10000, GR_indexed_bits = 0x10001, GR_point = 0x00002,
  GR_point_uniform_size = 0x00004, GR_per_point_size = 0x00008, GR_point_perspective = 0x00010, GR_point_aspect_ratio = 0x00020,
  GR_point_scale = 0x00040, GR_point_rotate = 0x00080, GR_point_sprite = 0x00100, GR_point_sprite_tex_matrix = 0x00200,
  GR_point_bits = 0x003fe, GR_triangle_strip = 0x00400, GR_triangle_fan = 0x00800, GR_line_strip = 0x01000,
  GR_composite_bits = 0x01c00, GR_strip_cut_index = 0x20000, GR_flat_first_vertex = 0x02000, GR_flat_last_vertex = 0x04000,
  GR_shade_model_bits = 0x06000, GR_render_mode_wireframe = 0x40000, GR_render_mode_point = 0x80000, GR_adjacency = 0x100000
}
 
enum  NumericType {
  NT_uint8, NT_uint16, NT_uint32, NT_packed_dcba,
  NT_packed_dabc, NT_float32, NT_float64, NT_stdfloat,
  NT_int8, NT_int16, NT_int32, NT_packed_ufloat
}
 
enum  PrimitiveType {
  PT_none, PT_polygons, PT_lines, PT_points,
  PT_patches
}
 
enum  ShadeModel { SM_uniform, SM_smooth, SM_flat_first_vertex, SM_flat_last_vertex }
 
enum  UsageHint {
  UH_client, UH_stream, UH_dynamic, UH_static,
  UH_unspecified
}
 

Detailed Description

This object describes how the vertex animation, if any, represented in a GeomVertexData is encoded.

Vertex animation includes soft-skinned skeleton animation and morphs (blend shapes), and might be performed on the CPU by Panda, or passed down to the graphics backed to be performed on the hardware (depending on the hardware's advertised capabilities).

Changing this setting doesn't by itself change the way the animation is actually performed; this just specifies how the vertices are set up to be animated.

Definition at line 38 of file geomVertexAnimationSpec.h.

Member Function Documentation

◆ compare_to()

int GeomVertexAnimationSpec::compare_to ( const GeomVertexAnimationSpec other) const
inline

Provides an arbitrary ordering between different animation specs.

Definition at line 136 of file geomVertexAnimationSpec.I.

Referenced by operator<().

◆ fillin()

void GeomVertexAnimationSpec::fillin ( DatagramIterator scan,
BamReader manager 
)

This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new GeomVertexAnimationSpec.

Definition at line 55 of file geomVertexAnimationSpec.cxx.

References DatagramIterator::get_bool(), DatagramIterator::get_uint16(), and DatagramIterator::get_uint8().

◆ operator<()

bool GeomVertexAnimationSpec::operator< ( const GeomVertexAnimationSpec other) const
inline

Provides an arbitrary ordering between different animation specs.

Definition at line 112 of file geomVertexAnimationSpec.I.

References compare_to().

◆ set_hardware()

void GeomVertexAnimationSpec::set_hardware ( int  num_transforms,
bool  indexed_transforms 
)
inline

Specifies that vertex animation is to be performed by the graphics hardware (or at least by the graphics backend API, which is actually still free to animate the vertices on the CPU).

This is only legal if the graphics hardware can support the specified limits on number of transforms and/or indexed transforms. Also, no current graphics API's support morphing.

Definition at line 102 of file geomVertexAnimationSpec.I.

Referenced by GraphicsStateGuardian::ensure_generated_shader().

◆ set_none()

void GeomVertexAnimationSpec::set_none ( )
inline

Specifies that no vertex animation is represented by this spec.

Definition at line 78 of file geomVertexAnimationSpec.I.

◆ set_panda()

void GeomVertexAnimationSpec::set_panda ( )
inline

Specifies that vertex animation is to be performed by Panda.

This is the most general setting and can handle any kind of vertex animation represented.

Definition at line 88 of file geomVertexAnimationSpec.I.

Referenced by PT().

◆ write_datagram()

void GeomVertexAnimationSpec::write_datagram ( BamWriter manager,
Datagram dg 
)

Writes the contents of this object to the datagram for shipping out to a Bam file.

Definition at line 44 of file geomVertexAnimationSpec.cxx.

References Datagram::add_bool(), Datagram::add_uint16(), and Datagram::add_uint8().

Member Data Documentation

◆ get_animation_type

GeomVertexAnimationSpec::AnimationType GeomVertexAnimationSpec::get_animation_type
inline

Returns the type of animation represented by this spec.

Definition at line 45 of file geomVertexAnimationSpec.h.

Referenced by CPT().

◆ get_indexed_transforms

bool GeomVertexAnimationSpec::get_indexed_transforms
inline

This is only meaningful for animation_type AT_hardware.

If true, it indicates that the format uses indexed animation tables. It is false if each vertex will reference the first _num_transforms table entries only.

Definition at line 50 of file geomVertexAnimationSpec.h.

◆ get_num_transforms

int GeomVertexAnimationSpec::get_num_transforms
inline

This is only meaningful for animation_type AT_hardware.

It specifies the maximum number of transforms that might be simultaneously applied to any one vertex by the data in this format.

Definition at line 49 of file geomVertexAnimationSpec.h.


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