public class Vector3Bvr extends Behavior { // Methods public Vector3Bvr div(NumberBvr scalar); public NumberBvr getSphericalCoordLength(); public NumberBvr getSphericalCoordXYAngle(); public NumberBvr getSphericalCoordYZAngle(); public NumberBvr getPolarCoordAngle(); public NumberBvr getX(); public NumberBvr getY(); public NumberBvr getZ(); public NumberBvr length(); public NumberBvr lengthSquared(); public Vector3Bvr mul(NumberBvr scalar); public Vector3Bvr normalize(); public Vector3Bvr transform(Transform3Bvr xf); public static Vector3Bvr newUninitBvr(); }
Creates an object that represents a three-dimensional vector behavior. At any given time, the value of the behavior is a direction and length (magnitude), specified as a triplet of coordinate values given as either Cartesian coordinates (x, y, z) or spherical coordinates (XYangle, YZangle, lenght). The direction of the vector is parallel to the ray that starts at the origin and passes through the point specified by the vector's coordinates, and the length is the distance between the origin and the point.
Because coordinate values are number behaviors (NumberBvr objects), the direction and length of the vector behavior may change over time as the number behaviors change. For more information about behaviors, see the Behavior class.
Creates a new three-dimensional vector behavior that points in the same direction as the original vector but has a length that has been divided by scalar.
public Vector3Bvr div(
NumberBvr scalar
);
Returns the Vector3Bvr object.
Returns the NumberBvr object that is the distance of the vector from the origin.
public NumberBvr getSphericalCoordLength( );
Returns the NumberBvr object.
getSphericalCoordXYAngle, getSphericalCoordYZAngle, vector3Spherical
Returns the NumberBvr object that is the counter-clockwise angle, in radians, of the vector about the y-axis, starting at positive z. The range is [-Pi, +Pi].
public NumberBvr getSphericalCoordXYAngle( );
Returns the NumberBvr object.
getSphericalCoordYZ, getSphericalCoordLength, vector3Spherical
Returns the NumberBvr object that is the YZ angle, in radians, going up from the XZ-plane towards the positive y-ray. The range is [-Pi/2, +Pi/2].
public NumberBvr getSphericalCoordYZAngle( );
Returns the NumberBvr object.
getSphericalCoordXYAngle, getSphericalCoordLength, vector3Spherical
Creates a number behavior that represents the x coordinate of this vector behavior.
public NumberBvr getX( );
Returns the NumberBvr object.
Creates a number behavior that represents the y coordinate of this vector behavior.
public NumberBvr getY( );
Returns the NumberBvr object.
Creates a number behavior that represents the z coordinate of this vector behavior.
public NumberBvr getZ( );
Returns the NumberBvr object.
Creates a number behavior that represents the length of a vector behavior.
public NumberBvr length( );
Returns the NumberBvr object.
Creates a number behavior that represents the length of a vector behavior squared.
public NumberBvr lengthSquared( );
Returns the NumberBvr object.
Creates a new three-dimensional vector behavior that points in the same direction as the original vector but has a length that has been multiplied by scalar.
public Vector3Bvr mul(
NumberBvr scalar
);
Returns the Vector3Bvr object.
Creates a normalized, three-dimensional vector behavior. The normalized vector has the same direction as the original vector, but the length is 1.
public Vector3Bvr normalize( );
Returns the Vector3Bvr object.
Creates a new three-dimensional vector behavior that is the result of applying the given transformation to the original vector. The translation elements of the transformation are ignored; translation does not apply to vectors.
public Vector3Bvr transform(
Transform3Bvr xf
);
Returns the Vector3Bvr object.
This attribute composes values.
This method allows you to refer to an Vector3Bvr 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.
public static Vector3Bvr newUninitBvr( );
Returns the Vector3Bvr object.
The following methods are defined in the Statics class and are most relevant to objects of type Vector3Bvr.
public static Vector3Bvr add(Vector3Bvr v1, Vector3Bvr v2);
public static Vector3Bvr cross(Vector3Bvr v1, Vector3Bvr v2);
public static Vector3Bvr derivative(Vector3Bvr vec);
public static NumberBvr dot(Vector3Bvr v1, Vector3Bvr v2);
public static Vector3Bvr integral(Vector3Bvr vec);
public static Vector3Bvr neg(Vector3Bvr v1);
public static Vector3Bvr sub(Vector3Bvr v1, Vector3Bvr v2);
public static Vector3Bvr vector3(NumberBvr x, NumberBvr y, NumberBvr z);
public static Vector3Bvr vector3Spherical(NumberBvr XYangle, NumberBvr YZangle, NumberBvr length);
The following fields are defined in the Statics class and are most relevant to objects of type Vector3Bvr.
public final static Vector3Bvr xVector3;
public final static Vector3Bvr yVector3;
public final static Vector3Bvr zVector3;
public final static Vector3Bvr zeroVector3;
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.