new ObjectOrientedBoundingBox
Creates an instance of an ObjectOrientedBoundingBox. An ObjectOrientedBoundingBox model of an object or set of objects, is a closed volume (a cuboid), which completely contains the object or the set of objects. It is oriented, so it can provide an optimum fit, it can bound more tightly.
Parameters:
| Name | Type | Argument | Default | Description | 
|---|---|---|---|---|
| rotation | Matrix3 | <optional> | Matrix3.IDENTITY | The transformation matrix, to rotate the box to the right position. | 
| translation | Cartesian3 | <optional> | Cartesian3.ZERO | The position of the box. | 
| scale | Cartesian3 | <optional> | Cartesian3.ZERO | The scale of the box. | 
Example
// Create an ObjectOrientedBoundingBox using a transformation matrix, a position where the box will be translated, and a scale. var rotation = Cesium.Matrix3.clone(Cesium.Matrix3.IDENTITY); var translation = new Cesium.Cartesian3(1,0,0); var scale = new Cesium.Cartesian3(0,5,0); var oobb = new Cesium.ObjectOrientedBoundingBox(rotation, translation, scale);
Members
- 
    rotation :Matrix3
- 
    
    The transformation matrix, to rotate the box to the right position.- Default Value:
 
- 
    scale :Cartesian3
- 
    
    The scale of the box.- Default Value:
 
- 
    translation :Cartesian3
- 
    
    The position of the box.- Default Value:
 
Methods
- 
    clone
- 
    
    
    Duplicates this ObjectOrientedBoundingBox instance. Parameters:Name Type Argument Description resultObjectOrientedBoundingBox <optional> 
 The object onto which to store the result. Returns:ObjectOrientedBoundingBox The modified result parameter or a new ObjectOrientedBoundingBox instance if one was not provided.
- 
    equals
- 
    
    
    Compares this ObjectOrientedBoundingBox against the provided ObjectOrientedBoundingBox componentwise and returns trueif they are equal,falseotherwise.Parameters:Name Type Argument Description rightObjectOrientedBoundingBox <optional> 
 The right hand side ObjectOrientedBoundingBox. Returns:Booleantrueif they are equal,falseotherwise.
- 
    <static> clone
- 
    
    
    Duplicates a ObjectOrientedBoundingBox instance. Parameters:Name Type Argument Description boxObjectOrientedBoundingBox The bounding box to duplicate. resultObjectOrientedBoundingBox <optional> 
 The object onto which to store the result. Returns:ObjectOrientedBoundingBox The modified result parameter or a new ObjectOrientedBoundingBox instance if none was provided. (Returns undefined if box is undefined)
- 
    <static> equals
- 
    
    
    Compares the provided ObjectOrientedBoundingBox componentwise and returns trueif they are equal,falseotherwise.Parameters:Name Type Description leftObjectOrientedBoundingBox The first ObjectOrientedBoundingBox. rightObjectOrientedBoundingBox The second ObjectOrientedBoundingBox. Returns:Booleantrueif left and right are equal,falseotherwise.
- 
    <static> fromBoundingRectangle
- 
    
    
    Computes an ObjectOrientedBoundingBox from a BoundingRectangle. The BoundingRectangle is placed on the XY plane. Parameters:Name Type Argument Default Description boundingRectangleBoundingRectangle A bounding rectangle. rotationNumber <optional> 
 0.0 The rotation of the bounding box in radians. Returns:ObjectOrientedBoundingBox The modified result parameter or a new ObjectOrientedBoundingBox instance if one was not provided.Example// Compute an object oriented bounding box enclosing two points. var box = Cesium.ObjectOrientedBoundingBox.fromBoundingRectangle(boundingRectangle, 0.0); 
- 
    <static> fromPoints
- 
    
    
    Computes an instance of an ObjectOrientedBoundingBox of the given positions. This is an implementation of Stefan Gottschalk's Collision Queries using Oriented Bounding Boxes solution (PHD thesis). Reference: http://gamma.cs.unc.edu/users/gottschalk/main.pdf Parameters:Name Type Argument Description positionsArray List of Cartesian3 points that the bounding box will enclose. resultObjectOrientedBoundingBox <optional> 
 The object onto which to store the result. Returns:ObjectOrientedBoundingBox The modified result parameter or a new ObjectOrientedBoundingBox instance if one was not provided.Example// Compute an object oriented bounding box enclosing two points. var box = Cesium.ObjectOrientedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]); 
- 
    <static> intersect
- 
    
    
    Checks if two ObjectOrientedBoundingBoxes intersect. This is an implementation of Stefan Gottschalk's Collision Queries using Oriented Bounding Boxes solution (PHD thesis). Parameters:Name Type Description leftObjectOrientedBoundingBox The first ObjectOrientedBoundingBox. rightObjectOrientedBoundingBox The second ObjectOrientedBoundingBox. Returns:Booleantrueif they intersects each otherfalseotherwise.
