DirectX Media for Animation Java Reference Previous
Previous
Classes
Classes
Index
Index
Next
Next

NumberBvr Class

Methods , Fields

public class NumberBvr extends Behavior {
    // Fields
    public static NumberBvr  globalTime;
    public static NumberBvr  localTime;
    
    // Methods
    public double extract() throws IllegalExtract;
    public StringBvr toString(NumberBvr a); 

    public static NumberBvr  abs(NumberBvr a);
    public static NumberBvr  acos(NumberBvr a);
    public static NumberBvr  add(NumberBvr a, NumberBvr b);
    public static NumberBvr  asin(NumberBvr a);
    public static NumberBvr  atan(NumberBvr a);
    public static NumberBvr  atan2(NumberBvr a, NumberBvr b);
    public static NumberBvr  bSpline(int degree, NumberBvr[] knots, NumberBvr[] control_elements, NumberBvr [] weights); 
    public static NumberBvr  ceiling(NumberBvr a);
    public static NumberBvr  cos(NumberBvr a);
    public static NumberBvr  degreesToRadians(NumberBvr a);
    public static NumberBvr  derivative(NumberBvr a);
    public static NumberBvr  div(NumberBvr a, NumberBvr b);
    public static BooleanBvr eq(NumberBvr a, NumberBvr b);
    public static NumberBvr  exp(NumberBvr a);
    public static NumberBvr  floor(NumberBvr a);
    public static BooleanBvr gt(NumberBvr a, NumberBvr b);
    public static BooleanBvr gte(NumberBvr a, NumberBvr b);
    public static NumberBvr  integral(NumberBvr a);
    public static NumberBvr  ln(NumberBvr a);
    public static NumberBvr  log10(NumberBvr a);
    public static BooleanBvr lt(NumberBvr a, NumberBvr b);
    public static BooleanBvr lte(NumberBvr a, NumberBvr b);
    public static NumberBvr  mod(NumberBvr a, NumberBvr b);
    public static NumberBvr  mul(NumberBvr a, NumberBvr b);
    public static BooleanBvr ne(NumberBvr a, NumberBvr b);
    public static NumberBvr  neg(NumberBvr a);
    public static NumberBvr  newUninitBvr();
    public static NumberBvr  pow(NumberBvr a, NumberBvr b);
    public static NumberBvr  radiansToDegrees(NumberBvr a);
    public static NumberBvr  round(NumberBvr a);
    public static NumberBvr  seededRandom(double seed);
    public static NumberBvr  sin(NumberBvr a);
    public static NumberBvr  sqrt(NumberBvr a);
    public static NumberBvr  sub(NumberBvr a, NumberBvr b);
    public static NumberBvr  tan(NumberBvr a);
    public static NumberBvr  toBvr(double a);
    }

Creates an object that represents a number behavior. At any given time, the value of the behavior is a floating point number.

For more information about behaviors, see the Behavior class.


Methods


extract

public double extract() throws IllegalExtract;

Extracts the value of the number behavior. The behavior must have a constant value.

Return Value:

Returns a floating point number.

Throws:

IllegalExtract Attempt to call on a non-constant NumberBvr object, such as created by the until method.


toString

public StringBvr toString(NumberBvr a); 

Converts a NumberBvr to a StringBvr.

Return Value:

StringBvr

ParameterDescription
a The NumberBvr object representing the number of digits to use after the decimal point.


abs

public static NumberBvr  abs(NumberBvr a);

Creates a number behavior that represents the absolute value of the given number behavior. The behavior's value is equal to the absolute value (the non-negative equivalent) of the value of a.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a The NumberBvr object to apply the operation to.


acos

public static NumberBvr acos(NumberBvr a);

Creates a number behavior that represents the arccosine (inverse cosine) of the given behavior.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a The NumberBvr object. The value of the behavior is assumed to be a cosine value.

See Also: asin


add

public static NumberBvr  add(NumberBvr a, NumberBvr b);

Creates a number behavior representing the sum of the given number behaviors. The behavior's value is the value of a added to the value of b (a + b).

Return Value:

Returns the NumberBvrobject.

ParameterDescription
a and b The NumberBvr objects to add.


asin

public static NumberBvr asin(NumberBvr a);

Creates a number behavior that represents the arcsine (inverse sine) of the given behavior.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a The NumberBvr object. The value of the behavior is assumed to be a sine value.

See Also: acos


atan

public static NumberBvr atan(NumberBvr a);

Creates a number behavior that represents the arctangent (inverse tangent) of the given behavior.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a The NumberBvr object.

See Also: acos, asin, atan2


atan2

public static NumberBvr atan2(NumberBvr a, NumberBvr b);

Creates a number behavior that represents the arctangent (inverse tangent) of the quotient of the given behaviors. The behavior's value is the inverse tangent of the value of a divided by the value of b.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a and b The NumberBvr objects to divide.

See Also: acos, asin


bSpline

public static NumberBvr bSpline(int degree, NumberBvr[] knots, NumberBvr[] control_elements, NumberBvr [] weights); 

Creates a NumberBvr object that defines a B-spline curve from which individual number behaviors, representing positions on the curve, can be evaluated. The shape of the curve depends on the mathematical degree of curve and whether weights are provided.

A B-spline with weights is rational, and without weights is non-rational (polynomial). The non-rational variety assumes that #points = numKnots - degree + 1. The knots represent known positions along the curve, and the control points define the direction and shape of the curve as it passes from one knot to the next.

Given a degree of curve d and a number of knots k, a position on the curve can be evaluated for any value in the range knotd to knotk-d+1. For example, for a degree 2 curve, the valid range is from the second knot to the next to the last knot, inclusive.

The returned NumberBvr is the evaluation of the spline curve according to time. By default, the spline parameter advances at a rate of one unit per second. To control the evaluation of the curve, use the substituteTime method. Times that are outside the valid range are clamped to the values at the endpoint of the spline.

Return Value:

Returns the NumberBvr object.

ParameterDescription
degree A number representing the mathematical degree of the B-spline to evaluate. Must be 1, 2, or 3.
knots An array of NumberBvr objects representing the knots used to calculate the B-spline.
control_elements An array of NumberBvr objects representing the control elements used to calculate the B-spline.
weights An array of NumberBvr objects representing the weights used to calculate the rational B-spline. There must be the same number of weights as control elements. For non-rational B-splines, the value of weights is null.


ceiling

public static NumberBvr  ceiling(NumberBvr a);

Creates a number behavior that represents the ceiling value, the smallest integer value that is greater than or equal to the value of the given behavior.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a The NumberBvr object to find the ceiling for.


cos

public static NumberBvr  cos(NumberBvr a);

Creates a number behavior that represents the cosine of the given behavior.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a The NumberBvr object. The value of the behavior is assumed to be in radians.

See Also: sin


degreesToRadians

public static NumberBvr  degreesToRadians(NumberBvr a);

Creates a number behavior that represents the value of the given behavior converted from degrees to radians.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a The NumberBvr object to convert.


derivative

public static NumberBvr derivative(NumberBvr a);

Creates a number behavior of the instantaneous derivative (rate of change) of the given number behavior. For example, a constant number yields a constant derivative of 0 and a value equal to "time" yields a constant derivative of 1.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a The NumberBvr object for which to calculate the derivative.


div

public static NumberBvr  div(NumberBvr a, NumberBvr b);

Creates an number behavior representing the quotient of the given number behaviors. The behavior's value is the value of a divided by the value of b (a/b).

Return Value:

Returns NumberBvr the object.

ParameterDescription
a and b The NumberBvr objects to divide.


eq

public static BooleanBvr eq(NumberBvr a, NumberBvr b);

Creates a Boolean behavior that represents the relation a = b. The behavior's value is true when the value of a is equal to the value of b, otherwise, it is false.

Return Value:

Returns the BooleanBvr object.

ParameterDescription
a and b The NumberBvr objects to compare.


exp

public static NumberBvr exp(NumberBvr a);

Creates a number behavior that represents the exponential of the given behavior. The behavior's value is the base of natural logarithms, e, raised to the power of the value of a.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a The NumberBvr object to apply as an exponent of e.

See Also: ln


floor

public static NumberBvr  floor(NumberBvr a);

Creates a number behavior that represents the floor value, the largest integer value that is less than or equal to the value of the given behavior.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a The NumberBvr object to find the floor for.


gt

public static BooleanBvr gt(NumberBvr a, NumberBvr b);

Creates a Boolean behavior that represents the relation a > b. The behavior's value is true when the value of a is greater than the value of b, otherwise, it is false.

Return Value:

Returns the BooleanBvr object.

ParameterDescription
a and b The NumberBvr objects to compare.


gte

public static BooleanBvr gte(NumberBvr a, NumberBvr b);

Creates a Boolean behavior that represents the relation a ³ b. The behavior's value is true when the value of a is greater than or equal to the value of b, otherwise, it is false.

Return Value:

Returns the BooleanBvr object.

ParameterDescription
a and b The NumberBvr objects to compare.


integral

public static NumberBvr integral(NumberBvr a);

Creates a number behavior that represents the sum of all values of a from the start time to the present.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a The NumberBvr object to integrate.


ln

public static NumberBvr ln(NumberBvr a);

Creates a number behavior that represents the natural logarithm of the given behavior. The behavior's value is the value by which the base of natural logarithms, e, must be raised to equal the value of a.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a The NumberBvr object for which to calculate the natural logarithm.

See Also: exp


log10

public static NumberBvr log10(NumberBvr a);

Creates a number behavior that represents the common logarithm (base-10 logarithm) of the given behavior. The behavior's value is the value by which 10 must be raised to equal the value of a.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a The NumberBvr object for which to calculate the common logarithm.


lt

public static BooleanBvr lt(NumberBvr a, NumberBvr b);

Creates a Boolean behavior that represents the relation a < b. The behavior's value is true when the value of a is less than the value of b, otherwise, it is false.

Return Value:

Returns the BooleanBvr object.

ParameterDescription
a and b The NumberBvr objects to compare.


lte

public static BooleanBvr lte(NumberBvr a, NumberBvr b);

Creates a Boolean behavior that represents the relation a £ b. The behavior's value is true when the value of a is less than or equal to the value of b, otherwise, it is false.

Return Value:

Returns the BooleanBvr object.

ParameterDescription
a and b The NumberBvr objects to compare.


mod

public static NumberBvr  mod(NumberBvr a, NumberBvr b);

Creates a number behavior that represents the modulus of the given behaviors. The behavior's value is the modulus, the remainder of the integer value of a divided by the integer value of b.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a and b The NumberBvr objects to calculate the modulus for.


mul

public static NumberBvr  mul(NumberBvr a, NumberBvr b);

Creates a number behavior representing the product of the given number behaviors. The behavior's value is the value of a multiplied by the value of b (a ´ b).

Return Value:

Returns the NumberBvr object.

ParameterDescription
a and b The NumberBvr objects to multiply.


ne

public static BooleanBvr ne(NumberBvr a, NumberBvr b);

Creates a BooleanBvr behavior that represents the relation a != b. The behavior's value is true when the value of a is not equal to the value of b, otherwise, it is false.

Return Value:

Returns the BooleanBvr object.

ParameterDescription
a and b The NumberBvr objects to compare.


neg

public static NumberBvr  neg(NumberBvr a);

Creates a number behavior representing the negation of the given number behavior. The behavior's value is equal to the value of a subtracted from zero (0 - a).

Return Value:

Returns the NumberBvr object.

ParameterDescription
a The NumberBvr object to negate.


newUninitBvr

public static NumberBvr newUninitBvr();

This method allows you to refer to an NumberBvr behavior before that behavior has been defined. With this method you can create the behavior and use it in the definition of other behaviors, but not actually define its contents until some later point. (This is accomplished with the init method, which is available on all behaviors.) The system generates a run-time error if you initialize a non-uninitialized behavior, initialize an uninitialized behavior that has already been initialized, or run an initialized behavior that has not yet been initialized.

Return Value:

Returns the NumberBvr object.


pow

public static NumberBvr pow(NumberBvr a, NumberBvr b);

Creates a number behavior representing a raised to the power of b. The behavior's value is equal to ab.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a and b The NumberBvr objects to apply the operation to.


radiansToDegrees

public static NumberBvr  radiansToDegrees(NumberBvr a);

Creates a number behavior that represents the value of the given behavior converted from radians to degrees.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a The NumberBvr object to convert.


round

public static Numberbvr round(NumberBvr a);

Creates a number behavior that represents the value of the given behavior, rounded to the nearest integer.

ParameterDescription
a The NumberBvr object to be rounded.


seededRandom

public static NumberBvr seededRandom(double seed);

Creates a number behavior that represents an infinite, time-varying sequence of pseudo-random values.

Return Value:

Returns the NumberBvr object.

ParameterDescription
seed The double that provides the seed, or starting value, for the sequence.


sin

public static NumberBvr sin(NumberBvr a);

Creates a number behavior that represents the sine of the given behavior.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a The NumberBvr object. The value of the behavior is assumed to be in radians.

See Also: cos


sqrt

public static NumberBvr  sqrt(NumberBvr a);

Creates a number behavior that represents the square root of the given number behavior. The behavior's value is the square root of the value of a.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a The NumberBvr object to apply the square root operation to.


sub

public static NumberBvr  sub(NumberBvr a, NumberBvr b);

Creates a number behavior representing the difference of the given number behaviors. The behavior's value is the value of b subtracted from a (a - b).

Return Value:

Returns the NumberBvr object.

ParameterDescription
a and b The NumberBvr objects to subtract.


tan

public static NumberBvr tan(NumberBvr a);

Creates a number behavior that represents the tangent of the given behavior.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a The NumberBvr object. The value of the behavior is assumed to be in radians.

See Also: atan, cos, sin


toBvr

public static NumberBvr toBvr(double a);

Converts a double floating-point number to a NumberBvr. The only time toBvr is used is when converting Java numbers, booleans, or strings to their corresponding Direct Animation types. It is not used for constants such as red, yVector3, and origin2 because these are defined as constant behaviors.

Return Value:

Returns the NumberBvr object.

ParameterDescription
a The double floating-point number to be converted.


Fields

globalTime
A number behavior (NumberBvr object) the value of which increases at the rate of one unit per second. Unlike localTime, the globalTime value cannot be reset to zero.
localTime
A number behavior (NumberBvr object) that starts a zero when "started" and increases at the rate of one unit per second.


Top© 1997 Microsoft Corporation. All rights reserved. Legal Notices.