VR-Vantage 3.1 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
ssShipWake Class Reference

Copyright JRM Enterprises, Inc. More...

Classes

struct  ssShipWakePoint
 Structure to hold a single ship wake sample point. More...

Public Member Functions

 ssShipWake ()
 Default Constructor.
ssShipWakePointgetWakePoints ()
 Get a pointer to the array of wake points.
void setNumPoints (int numPoints)
 Set the number of wake points that this class should maintain.
int getNumPoints ()
 Get the number of wake points that are in the array of wake points that this class returns when getWakePoints() is called.
void setOffset (float x, float y)
 Set the offset amount, measured from the center of the ship, that the wake should emanate or start from.
void getOffset (float &x, float &y)
 Get the offset amount, measured from the center of the ship, that the wake is emanated or starts from.
void setWidth (float initial, float maximum)
 Each new wake point will start with the initial width and will expand over time until it reaches the maximum width.
void getWidth (float &initial, float &maximum)
 Get the initial and maximum width values that are being used.
void setTimeOfMaxWidth (float time)
 Set the amount of time that any point of the ship wake should continue to expand.
float getTimeOfMaxWidth ()
 Get the time at which a wake point will have reached its maximum width and will no longer expand.
void setTimeAlphaBegins (float time)
 Set the time at which a wake point will go from being 100% opaque to starting to become transparent.
float getTimeAlphaBegins ()
 Get the time at which the linear transition from 100% opaque to 100% transparent begins.
void setTextureFlowRate (float unitsPerSecond)
 Set the number of texture units that flow past the leading edge of the wake in one second.
float getTextureFlowRate ()
 Get the number of texture units that flow past the leading edge of the wake in one second.
void update (double x, double y, double z, double heading, double pitch, double roll, double time)
 Update the position and orientation of the ship without any wave motion.

Private Member Functions

void pushRight ()
 Move all the data in the array of wake points to the right one location.
void initializeData (int numPoint)
 Create and/or zero out the wake point data that this class uses.

Private Attributes

ssShipWakePointm_wakePoints
double m_previousPosX
double m_previousPosY
float m_wakeOffsetX
float m_wakeOffsetY
float m_initialWidth
float m_maximumWidth
float m_timeOfMaxWidth
float m_timeAlphaBegins
float m_textureFlowRate
float m_textureOffset
int m_numPoints

Detailed Description

Copyright JRM Enterprises, Inc.

  1. All rights reserved.

This code is the intellectual property of JRM Enterprises, Inc. It may not be used or released as source or compiled binary form without the prior written consent of JRM Enterprises, Inc. ...text...

Constructor & Destructor Documentation

ssShipWake::ssShipWake ( )

Default Constructor.

Member Function Documentation

ssShipWakePoint* ssShipWake::getWakePoints ( )

Get a pointer to the array of wake points.

Use the getNumPoints() method to determine how many wake points in in this array.

void ssShipWake::setNumPoints ( int  numPoints)

Set the number of wake points that this class should maintain.

This class will creat ONE new wake at the head of the wake and remove ONE wake point from the tail every second. So, the number of points also defines the number of seconds that any wake point will be visitable.

int ssShipWake::getNumPoints ( )
inline

Get the number of wake points that are in the array of wake points that this class returns when getWakePoints() is called.

void ssShipWake::setOffset ( float  x,
float  y 
)
inline

Set the offset amount, measured from the center of the ship, that the wake should emanate or start from.

void ssShipWake::getOffset ( float &  x,
float &  y 
)
inline

Get the offset amount, measured from the center of the ship, that the wake is emanated or starts from.

void ssShipWake::setWidth ( float  initial,
float  maximum 
)
inline

Each new wake point will start with the initial width and will expand over time until it reaches the maximum width.

Maximum width will occur at the time set by using the setTimeOfMaxWidth() method.

void ssShipWake::getWidth ( float &  initial,
float &  maximum 
)
inline

Get the initial and maximum width values that are being used.

void ssShipWake::setTimeOfMaxWidth ( float  time)
inline

Set the amount of time that any point of the ship wake should continue to expand.

After this amount of time has passed for a wake point, it will no longer change size and will be at its final or maximum width.

float ssShipWake::getTimeOfMaxWidth ( )
inline

Get the time at which a wake point will have reached its maximum width and will no longer expand.

void ssShipWake::setTimeAlphaBegins ( float  time)
inline

Set the time at which a wake point will go from being 100% opaque to starting to become transparent.

Wake points will always be 100% transparent before they are removed from the end of the wake. This value sets the time at which the linear transition from 100% opaque to 100% transparent begins.

float ssShipWake::getTimeAlphaBegins ( )
inline

Get the time at which the linear transition from 100% opaque to 100% transparent begins.

void ssShipWake::setTextureFlowRate ( float  unitsPerSecond)
inline

Set the number of texture units that flow past the leading edge of the wake in one second.

This will effect how stretched or compressed the texture will look from the beginning to the end of the wake. If the flow rate is set to 0.25, the wake texture will repeat every 4 seconds. If set to 2.0, the wake texture will repeat every 0.5 seconds.

float ssShipWake::getTextureFlowRate ( )
inline

Get the number of texture units that flow past the leading edge of the wake in one second.

void ssShipWake::update ( double  x,
double  y,
double  z,
double  heading,
double  pitch,
double  roll,
double  time 
)

Update the position and orientation of the ship without any wave motion.

This should be the calm sea position and orientation of the ship

void ssShipWake::pushRight ( )
private

Move all the data in the array of wake points to the right one location.

The data in array location 0 and 1 will be the same upon return and the data that was in the last array location will no longer exist.

void ssShipWake::initializeData ( int  numPoint)
private

Create and/or zero out the wake point data that this class uses.

If the number of points passed in does not match the number of points that are currently being used, the current wake points will be freed and new ones allocated.

Member Data Documentation

ssShipWakePoint* ssShipWake::m_wakePoints
private
double ssShipWake::m_previousPosX
private
double ssShipWake::m_previousPosY
private
float ssShipWake::m_wakeOffsetX
private
float ssShipWake::m_wakeOffsetY
private
float ssShipWake::m_initialWidth
private
float ssShipWake::m_maximumWidth
private
float ssShipWake::m_timeOfMaxWidth
private
float ssShipWake::m_timeAlphaBegins
private
float ssShipWake::m_textureFlowRate
private
float ssShipWake::m_textureOffset
private
int ssShipWake::m_numPoints
private

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


Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)