[name]
This is a superefficent class for geometries because it saves all data in buffers.
It reduces memory costs and cpu cycles. But it is not as easy to work with because of all the necessary buffer calculations.
It is mainly interesting when working with static objects.
Constructor
[name]()
This creates a new [name]. It also sets several properties to an default value.
Properties
.[page:Integer id]
Unique number of this buffergeometry instance
.[page:Hashmap attributes]
This hashmap has as id the name of the attribute to be set and as value the buffer to set it to.
.[page:Boolean dynamic]
When set, it holds certain buffers in memory to have faster updates for this object. When unset, it deletes those buffers and saves memory.
.[page:Array offsets]
This Array should contain every offset at which the buffers should be rendered. This is important for indexed buffers.
.[page:Object boundingBox]
Bounding box.
{ min: new THREE.Vector3(), max: new THREE.Vector3() }
.[page:Object boundingSphere]
Bounding sphere.
{ radius: float }
.[page:Array morphTargets]
Array of morph targets. Each morph target is a Javascript object:
{ name: "targetName", vertices: [ new THREE.Vertex(), ... ] }
Morph vertices match number and order of primary vertices.
.[page:boolean hasTangents]
True if BufferGeometry has tangents. Set in [page:BufferGeometry BufferGeometry.computeTangents].
Methods
[page:EventDispatcher EventDispatcher] methods are available on this class.
.applyMatrix( [page:Matrix4 matrix] )
Bakes matrix transform directly into vertex coordinates.
.computeVertexNormals()
Computes vertex normals by averaging face normals.
.computeTangents()
Computes vertex tangents.
Based on [link:http://www.terathon.com/code/tangent.html]
Geometry must have vertex [page:UV UVs] (layer 0 will be used).
.computeBoundingBox()
Computes bounding box of the geometry, updating [page:Geometry Geometry.boundingBox] attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are *null*.
.computeBoundingSphere()
Computes bounding sphere of the geometry, updating [page:Geometry Geometry.boundingSphere] attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are *null*.
.dispose()
Disposes the object from memory.
You need to call this when you want the bufferGeometry removed while the application is running.
.normalizeNormals()
Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
Source
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]