Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions

FltTransformRotateScale Class Reference

A combination rotation and scale. More...

#include "fltTransformRotateScale.h"

Inheritance diagram for FltTransformRotateScale:
FltTransformRecord FltRecord TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase

List of all members.

Public Member Functions

 FltTransformRotateScale (FltHeader *header)
virtual TypeHandle force_init_type ()
PN_stdfloat get_angle () const
 Returns the angle of rotation in degrees.
PN_stdfloat get_axis_scale () const
 Returns the scale factor in the direction of the axis.
const LPoint3dget_center () const
PN_stdfloat get_overall_scale () const
 Returns the overall scale factor.
const LPoint3dget_reference_point () const
const LPoint3dget_to_point () const
virtual TypeHandle get_type () const
void set (const LPoint3d &center, const LPoint3d &reference_point, const LPoint3d &to_point, bool axis_scale)
 Defines the transform explicitly.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96.

Protected Member Functions

virtual bool build_record (FltRecordWriter &writer) const
 Fills up the current record on the FltRecordWriter with data for this record, but does not advance the writer.
virtual bool extract_record (FltRecordReader &reader)
 Fills in the information in this record based on the information given in the indicated datagram, whose opcode has already been read.

Detailed Description

A combination rotation and scale.

This is sometimes called "Rotate To Point" within MultiGen.

Definition at line 27 of file fltTransformRotateScale.h.


Member Function Documentation

bool FltTransformRotateScale::build_record ( FltRecordWriter writer) const [protected, virtual]

Fills up the current record on the FltRecordWriter with data for this record, but does not advance the writer.

Returns true on success, false if there is some error.

Reimplemented from FltRecord.

Definition at line 212 of file fltTransformRotateScale.cxx.

References Datagram::add_be_float32(), Datagram::add_be_float64(), FltRecord::build_record(), Datagram::pad_bytes(), FltRecordWriter::set_opcode(), and FltRecordWriter::update_datagram().

bool FltTransformRotateScale::extract_record ( FltRecordReader reader) [protected, virtual]

Fills in the information in this record based on the information given in the indicated datagram, whose opcode has already been read.

Returns true on success, false if the datagram is invalid.

Reimplemented from FltRecord.

Definition at line 172 of file fltTransformRotateScale.cxx.

References FltRecord::check_remaining_size(), FltRecord::extract_record(), FltRecordReader::get_iterator(), FltRecordReader::get_opcode(), and DatagramIterator::skip_bytes().

PN_stdfloat FltTransformRotateScale::get_angle ( ) const

Returns the angle of rotation in degrees.

Definition at line 132 of file fltTransformRotateScale.cxx.

PN_stdfloat FltTransformRotateScale::get_axis_scale ( ) const

Returns the scale factor in the direction of the axis.

Definition at line 122 of file fltTransformRotateScale.cxx.

PN_stdfloat FltTransformRotateScale::get_overall_scale ( ) const

Returns the overall scale factor.

Definition at line 111 of file fltTransformRotateScale.cxx.

static void FltTransformRotateScale::init_type ( ) [inline, static]

This function is declared non-inline to work around a compiler bug in g++ 2.96.

Making it inline seems to cause problems in the optimizer.

Reimplemented from FltTransformRecord.

Definition at line 63 of file fltTransformRotateScale.h.

void FltTransformRotateScale::set ( const LPoint3d center,
const LPoint3d reference_point,
const LPoint3d to_point,
bool  axis_scale 
)

Defines the transform explicitly.

The angle of rotation is determined by the angle between the reference point and the to point (relative to the center), and the scale factor is determined by the distance between the reference point and the center point. If axis_scale is true, the scale is along reference point axis only; otherwise, it is a uniform scale.

Definition at line 52 of file fltTransformRotateScale.cxx.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations