Home Hierarchy Members Alphabetical Related Pages

MovieTexture Class Reference
[Standard Node Types]

#include <movietexture.h>

Inherits Node.

List of all members.

Public Member Functions

 MovieTexture (const char *name="")
virtual ~MovieTexture ()
virtual unsigned int nbFields () const
virtual FieldHandle field (const std::string &n)
virtual FieldHandle field (unsigned int i)
virtual bool isSetToDefaultValue (unsigned int i) const
virtual unsigned int nbEventsIn () const
virtual EventInHandle eventIn (const std::string &n)
virtual EventInHandle eventIn (unsigned int i)
virtual unsigned int nbEventsOut () const
virtual EventOutHandle eventOut (const std::string &n)
virtual EventOutHandle eventOut (unsigned int i)
const char * typeName () const
virtual Nodeduplicate () const
virtual Nodeduplicate (std::map< const Node *, Node * > &) const

Public Attributes

Exposed Fields
A field that is capable of receiving events via an eventIn to change its value(s), and generating events via an eventOut when its value(s) change.

SFBool loop
SFFloat speed
SFTime startTime
SFTime stopTime
MFString url
Fields
A property or attribute of a node. Each node type has a fixed set of fields. Fields may contain various kinds of data and one or many values. Each field has a default value.

SFBool repeatS
SFBool repeatT
Events In
EventIn< SFBoolset_loop
EventIn< SFFloatset_speed
EventIn< SFTimeset_startTime
EventIn< SFTimeset_stopTime
EventIn< MFStringset_url
Events Out
EventOut< SFTimeduration_changed
EventOut< SFBoolisActive
EventOut< SFBoolloop_changed
EventOut< SFFloatspeed_changed
EventOut< SFTimestartTime_changed
EventOut< SFTimestopTime_changed
EventOut< MFStringurl_changed


Detailed Description

Here is the documentation for this node type, from the ISO standard.

+6.40 MovieTexture

The MovieTexture node defines a time dependent texture map (contained in a movie file) and parameters for controlling the movie and the texture mapping. A MovieTexture node can also be used as the source of sound data for a Sound node. In this special case, the MovieTexture node is not used for rendering.

Texture maps are defined in a 2D coordinate system (s, t) that ranges from 0.0 to 1.0 in both directions. The bottom edge of the image corresponds to the S-axis of the texture map, and left edge of the image corresponds to the T-axis of the texture map. The lower-left pixel of the image corresponds to s=0.0, t=0.0, and the top-right pixel of the image corresponds to s=1.0, t=1.0. Figure 6.12 depicts the texture map coordinate system of the MovieTexture.

MovieTexture node

Figure 6.12 -- MovieTexture node coordinate system

The url field that defines the movie data shall support MPEG1-Systems (audio and video) or MPEG1-Video (video-only) movie file formats 2.[MPEG]. Details on the url field can be found in 4.5, VRML and the World Wide Web.

MovieTexture nodes can be referenced by an Appearance node's texture field (as a movie texture) and by a Sound node's source field (as an audio source only).

See 4.6.11, Texture maps, for a general description of texture maps.

4.14, Lighting model, contains details on lighting equations and the interaction between textures, materials, and geometries.

As soon as the movie is loaded, a duration_changed eventOut is sent. This indicates the duration of the movie in seconds. This eventOut value can be read (for instance, by a Script node) to determine the duration of a movie. A value of "-1" implies the movie has not yet loaded or the value is unavailable for some reason.

The loop, startTime, and stopTime exposedFields and the isActive eventOut, and their effects on the MovieTexture node, are discussed in detail in the 4.6.9, Time-dependent nodes, section. The cycle of a MovieTexture node is the length of time in seconds for one playing of the movie at the specified speed.

The speed exposedField indicates how fast the movie shall be played. A speed of 2 indicates the movie plays twice as fast. The duration_changed output is not affected by the speed exposedField. set_speed events are ignored while the movie is playing. A negative speed implies that the movie will play backwards.

If a MovieTexture node is inactive when the movie is first loaded, frame 0 of the movie texture is displayed if speed is non-negative or the last frame of the movie texture is shown if speed is negative (see 4.11.3, Discrete and continuous changes). A MovieTexture node shall display frame 0 if speed = 0. For positive values of speed, an active MovieTexture node displays the frame at movie time t as follows (i.e., in the movie's local time system with frame 0 at time 0 with speed = 1):

    t = (now - startTime) modulo (duration/speed)

If speed is negative, the MovieTexture node displays the frame at movie time:

    t = duration - ((now - startTime) modulo |duration/speed|)

When a MovieTexture node becomes inactive, the frame corresponding to the time at which the MovieTexture became inactive will remain as the texture.

--- VRML separator bar ---


Constructor & Destructor Documentation

MovieTexture ( const char *  name = ""  ) 

Construct a node with all its fields set to default value, which is equivalent to the code below:

  loop = false;
  speed = 1.0f;
  startTime.setNbSeconds(0);
  stopTime.setNbSeconds(0);
  repeatS = true;
  repeatT = true;

~MovieTexture (  )  [virtual]

Virtual destructor, does nothing


Member Function Documentation

unsigned int nbFields (  )  const [inline, virtual]

Returns the number of fields (exposed or not) for this node type.

Implements Node.

wrl::Node::FieldHandle field ( const std::string &  n  )  [virtual]

Return a handle on the field named n of the node or a "unknown" typed handle if there is no such field. Valid names are:

Implements Node.

wrl::Node::FieldHandle field ( unsigned int  n  )  [virtual]

Return a handle on the i th field of the node or a "unknown" typed handle if there is no such node. Here is how i is related to fields:

Implements Node.

bool isSetToDefaultValue ( unsigned int  i  )  const [virtual]

Implements Node.

unsigned int nbEventsIn (  )  const [inline, virtual]

Returns the number of events in for this node type.

Implements Node.

wrl::Node::EventInHandle eventIn ( const std::string &  n  )  [virtual]

Return a handle on the event in named n of the node or a "unknown" typed handle if there is no such event. Valid names are:

Implements Node.

wrl::Node::EventInHandle eventIn ( unsigned int  n  )  [virtual]

Return a handle on the i th event in of the node or a "unknown" typed handle if there is no such node. emarks This class has no eventIn. This function is useful, with nbEventsIn() if you want to traverse all events in of a Node.

Implements Node.

unsigned int nbEventsOut (  )  const [inline, virtual]

Returns the number of events out for this node type.

Implements Node.

wrl::Node::EventOutHandle eventOut ( const std::string &  n  )  [virtual]

Return a handle on the event out named n of the node or a "unknown" typed handle if there is no such event. Valid names are:

Implements Node.

wrl::Node::EventOutHandle eventOut ( unsigned int  n  )  [virtual]

Return a handle on the i th event out of the node or a "unknown" typed handle if there is no such node. Here is how i is related to fields:

Implements Node.

const char * typeName (  )  const [inline, virtual]

Returns "MovieTexture". Useful for printing.

Implements Node.

wrl::Node * duplicate (  )  const [virtual]

Returns a deep copy of this node, that is a fully independant node with all children (if any) also copied. This is mainly useful for instanciating protos.

Implements Node.

virtual Node* duplicate ( std::map< const Node *, Node * > &   )  const [virtual]

Implements Node.


Member Data Documentation

SFBool loop

See Detailed Description for meaning of this field. Default value is set to

       loop = false;

SFFloat speed

See Detailed Description for meaning of this field. Default value is set to

       speed = 1.0f;

SFTime startTime

See Detailed Description for meaning of this field. Default value is set to

       startTime.setNbSeconds(0);

SFTime stopTime

See Detailed Description for meaning of this field. Default value is set to

       stopTime.setNbSeconds(0);

MFString url

See Detailed Description for meaning of this field. Default value is set to MFString default value

SFBool repeatS

See Detailed Description for meaning of this field. Default value is set to

       repeatS = true;

SFBool repeatT

See Detailed Description for meaning of this field. Default value is set to

       repeatT = true;

EventIn<SFBool> set_loop

Set event associated to exposedField loop

EventIn<SFFloat> set_speed

Set event associated to exposedField speed

EventIn<SFTime> set_startTime

Set event associated to exposedField startTime

EventIn<SFTime> set_stopTime

Set event associated to exposedField stopTime

EventIn<MFString> set_url

Set event associated to exposedField url

EventOut<SFTime> duration_changed

See Detailed Description for meaning of this event.

EventOut<SFBool> isActive

See Detailed Description for meaning of this event.

EventOut<SFBool> loop_changed

Changed event associated to exposedField loop

EventOut<SFFloat> speed_changed

Changed event associated to exposedField speed

EventOut<SFTime> startTime_changed

Changed event associated to exposedField startTime

EventOut<SFTime> stopTime_changed

Changed event associated to exposedField stopTime

EventOut<MFString> url_changed

Changed event associated to exposedField url


Generated on 5 Jan 2007 with doxygen version 1.5.1. Valid HTML 4.0! Valid CSS!