#include <valfunc.h>
Inheritance diagram for ValueFunctionTeardrop:
Public Member Functions | |
ValueFunctionTeardrop (double MaxPosition=0.20) | |
virtual double | GetValue (double Position) |
To read the value of this function at a given position. | |
virtual ValueFunctionID | GetUniqueID (void) |
Protected Member Functions | |
virtual ValueFunctionBlip * | CreateInstance (void) |
Creates a new blank object of the same type as this one. Internal function used in ValueFunctionTeardrop & ValueFunctionTeardropS. | |
Private Member Functions | |
CC_DECLARE_DYNAMIC (ValueFunctionTeardrop) |
Definition at line 707 of file valfunc.h.
|
Definition at line 712 of file valfunc.h. 00712 : ValueFunctionBlip(MaxPosition) {};
|
|
|
|
Creates a new blank object of the same type as this one. Internal function used in ValueFunctionTeardrop & ValueFunctionTeardropS.
Reimplemented from ValueFunctionBlip. Definition at line 2582 of file valfunc.cpp. 02583 { 02584 return(new ValueFunctionTeardrop); 02585 }
|
|
Reimplemented from ValueFunctionBlip. Definition at line 715 of file valfunc.h. 00715 { return(ValueFunctionID_Teardrop); };
|
|
To read the value of this function at a given position.
Reimplemented from ValueFunctionBlip. Definition at line 2541 of file valfunc.cpp. 02542 { 02543 double Value; 02544 if (Position < MaxPos) 02545 { 02546 Position = 1.0 - Position/MaxPos; 02547 if ( Position>1.0 ) 02548 Position = 1.0; 02549 Value = sqrt(1-Position*Position); 02550 } 02551 else 02552 { 02553 Position = (Position - MaxPos) / (1.0 - MaxPos); 02554 Value = (cos( Position * Pi) + 1.0) / 2.0; 02555 } 02556 02557 return Value; 02558 }
|