Add more and more examples to three-tests.ts

This commit is contained in:
Kon
2013-03-04 07:44:48 +09:00
parent 6a43b6fe85
commit f34f352f9b
2 changed files with 5065 additions and 17 deletions

File diff suppressed because it is too large Load Diff

77
threejs/three.d.ts vendored
View File

@@ -88,14 +88,15 @@ module THREE {
export var AddOperation: Combine;
// Mapping modes
export interface Mapping {
export enum Mapping { }
export interface MappingConstructor {
new(): Mapping;
}
export var UVMapping: Mapping;
export var CubeReflectionMapping: Mapping;
export var CubeRefractionMapping: Mapping;
export var SphericalReflectionMapping: Mapping;
export var SphericalRefractionMapping: Mapping;
export var UVMapping: MappingConstructor;
export var CubeReflectionMapping: MappingConstructor;
export var CubeRefractionMapping: MappingConstructor;
export var SphericalReflectionMapping: MappingConstructor;
export var SphericalRefractionMapping: MappingConstructor;
// Wrapping modes
export enum Wrapping { }
@@ -185,6 +186,24 @@ module THREE {
// Core ///////////////////////////////////////////////////////////////////////////////////////////////
interface BufferGeometryAttributeArray extends ArrayBufferView{
length: number;
}
interface BufferGeometryAttribute{
itemSize: number;
array: BufferGeometryAttributeArray;
numItems: number;
}
interface BufferGeometryAttributes{
[name: string]: BufferGeometryAttribute;
index?: BufferGeometryAttribute;
position?: BufferGeometryAttribute;
normal?: BufferGeometryAttribute;
color?: BufferGeometryAttribute;
}
/**
* 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 nessecary buffer calculations.
@@ -206,7 +225,7 @@ module THREE {
/**
* This hashmap has as id the name of the attribute to be set and as value the buffer to set it to.
*/
attributes: { [name: string]: any; };
attributes: BufferGeometryAttributes;
/**
* When set, it holds certain buffers in memory to have faster updates for this object. When unset, it deletes those buffers and saves memory.
@@ -226,6 +245,8 @@ module THREE {
hasTangents: bool;
morphTargets: any[];
offsets: { start: number; count: number; index: number; }[];
/**
* Bakes matrix transform directly into vertex coordinates.
*/
@@ -3876,6 +3897,7 @@ module THREE {
export interface Uniforms {
[name: string]: { type: string; value: any; };
//[name:string]:{type:UniformType;value:Object;};
color?: { type: string; value: THREE.Color; };
}
export interface ShaderMaterialParameters {
@@ -3928,6 +3950,9 @@ module THREE {
constructor(geometry?: Geometry, material?: LineDashedMaterial, type?: number);
constructor(geometry?: Geometry, material?: LineBasicMaterial, type?: number);
constructor(geometry?: Geometry, material?: ShaderMaterial, type?: number);
constructor(geometry?: BufferGeometry, material?: LineDashedMaterial, type?: number);
constructor(geometry?: BufferGeometry, material?: LineBasicMaterial, type?: number);
constructor(geometry?: BufferGeometry, material?: ShaderMaterial, type?: number);
geometry: Geometry;
material: Material;
type: LineType;
@@ -3954,6 +3979,15 @@ module THREE {
constructor(geometry?: Geometry, material?: MeshNormalMaterial);
constructor(geometry?: Geometry, material?: MeshPhongMaterial);
constructor(geometry?: Geometry, material?: ShaderMaterial);
constructor(geometry?: BufferGeometry , material?: MeshBasicMaterial);
constructor(geometry?: BufferGeometry , material?: MeshDepthMaterial);
constructor(geometry?: BufferGeometry , material?: MeshFaceMaterial);
constructor(geometry?: BufferGeometry , material?: MeshLambertMaterial);
constructor(geometry?: BufferGeometry , material?: MeshNormalMaterial);
constructor(geometry?: BufferGeometry , material?: MeshPhongMaterial);
constructor(geometry?: BufferGeometry , material?: ShaderMaterial);
geometry: Geometry;
material: Material;
morphTargetBase: number;
@@ -4010,6 +4044,10 @@ module THREE {
constructor(geometry: Geometry, material?: ParticleCanvasMaterial);
constructor(geometry: Geometry, material?: ParticleDOMMaterial);
constructor(geometry: Geometry, material?: ShaderMaterial);
constructor(geometry: BufferGeometry, material?: ParticleBasicMaterial);
constructor(geometry: BufferGeometry, material?: ParticleCanvasMaterial);
constructor(geometry: BufferGeometry, material?: ParticleDOMMaterial);
constructor(geometry: BufferGeometry, material?: ShaderMaterial);
/**
* An instance of Geometry, where each vertex designates the position of a particle in the system.
@@ -4037,13 +4075,13 @@ module THREE {
}
export class SkinnedMesh extends Mesh {
constructor(geometry?: Geometry, material?: MeshBasicMaterial);
constructor(geometry?: Geometry, material?: MeshDepthMaterial);
constructor(geometry?: Geometry, material?: MeshFaceMaterial);
constructor(geometry?: Geometry, material?: MeshLambertMaterial);
constructor(geometry?: Geometry, material?: MeshNormalMaterial);
constructor(geometry?: Geometry, material?: MeshPhongMaterial);
constructor(geometry?: Geometry, material?: ShaderMaterial);
constructor(geometry?: Geometry, material?: MeshBasicMaterial, useVertexTexture?: bool);
constructor(geometry?: Geometry, material?: MeshDepthMaterial, useVertexTexture?: bool);
constructor(geometry?: Geometry, material?: MeshFaceMaterial, useVertexTexture?: bool);
constructor(geometry?: Geometry, material?: MeshLambertMaterial, useVertexTexture?: bool);
constructor(geometry?: Geometry, material?: MeshNormalMaterial, useVertexTexture?: bool);
constructor(geometry?: Geometry, material?: MeshPhongMaterial, useVertexTexture?: bool);
constructor(geometry?: Geometry, material?: ShaderMaterial, useVertexTexture?: bool);
useVertexTexture: bool;
identityMatrix: Matrix4;
bones: Bone[];
@@ -4939,6 +4977,8 @@ module THREE {
getNextKeyWith(type: string, h: number, key: number): KeyFrame; // ????
getPrevKeyWith(type: string, h: number, key: number): KeyFrame;
JITCompile: bool; // https://github.com/mrdoob/three.js/blob/master/examples/webgl_animation_skinning_morph.html#L251
}
export class AnimationInterpolation { }
@@ -5449,7 +5489,7 @@ module THREE {
}
export class ConvexGeometry extends Geometry {
constructor(vertices: Vector3);
constructor(vertices: Vector3[]);
}
/**
@@ -5597,7 +5637,12 @@ module THREE {
}
export class TubeGeometry extends Geometry {
constructor(path: Path, segments?: number, radius?: number, radiusSegments?: number, closed?: bool, debug?: ArrowHelper[]);
constructor(path: Path, segments?: number, radius?: number, radiusSegments?: number, closed?: bool, debug?: Object3D);
// https://github.com/mrdoob/three.js/blob/master/examples/webgl_geometry_extrude_shapes.html#L208
// Hmmm?
constructor(path: SplineCurve3, segments?: number, radius?: number, radiusSegments?: number, closed?: bool, debug?: bool);
path: Path;
segments: number;
radius: number;