Skip to content

Commit

Permalink
huge commit; basically all updated
Browse files Browse the repository at this point in the history
  • Loading branch information
jroblak committed Oct 8, 2013
1 parent 36b5faa commit 76da625
Show file tree
Hide file tree
Showing 44 changed files with 1,552 additions and 523 deletions.
2 changes: 2 additions & 0 deletions Typescript/Animations/babylon.animatable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ declare module BABYLON {

constructor(target: Object, from: number, to: number, loop: boolean, speedRatio: number, onAnimationEnd: Function);

animationStarted: boolean;

_animate(delay: number): boolean;
}
}
2 changes: 1 addition & 1 deletion Typescript/Bones/babylon.bone.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ declare module BABYLON {
children: Bone[];
animation: Animation[];

constructor(name: string, skeleton: Skeleton; parentBone: Bone, matrix: Matrix);
constructor(name: string, skeleton: Skeleton, parentBone: Bone, matrix: Matrix);

getParent(): Bone;
getLocalMatrix: Matrix;
Expand Down
22 changes: 8 additions & 14 deletions Typescript/Collisions/babylon.collider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,19 @@ declare module BABYLON {
radius: Vector3;
retry: number;

basePointWorld: Vector3;
velocityWorld: Vector3;
normalizedVelocity: Vector3;

constructor();

_initialize(source: Vector3, dir: Vector3, e: number): void;
_canDoCollision(sphereCenter: Vector3, sphereRadius: number, vecMin: Vector3, vecMax: Vector3): bool;
_checkPontInTriangle(point: Vector3, pa: Vector3, pb: Vector3, pc: Vector3, n: Vector3): boolean;
intersectBoxAASphere(boxMin: Vector3, boxMax: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean;
getLowestRoot(a: number, b: number, c: number, maxR: number): Object;
_canDoCollision(sphereCenter: Vector3, sphereRadius: number, vecMin: Vector3, vecMax: Vector3): boolean;
_testTriangle(subMesh: SubMesh, p1: Vector3, p2: Vector3, p3: Vector3): void;
_collide(subMesh: SubMesh, pts: VertexBuffer, indices: IndexBuffer, indexStart: number, indexEnd: number, decal: number);
_getResponse(pos: Vector3, vel: Vector3): CollisionResponse;
}

class CollisionPlane {
normal: Vector3;
origin: Vector3;
equation: number[];

constructor(origin: Vector3, normal: Vector3);

isFrontFactingTo(direction: Vector3, epsilon: number): bool;
signedDistanceTo(point: Vector3): number;

static CreateFromPoints(p1: Vector3, p2: Vector3, p3: Vector3): CollisionPlane;
}
}
16 changes: 16 additions & 0 deletions Typescript/Collisions/babylon.collisionPlane.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/// <reference path="../babylon.d.ts" />

declare module BABYLON {
class CollisionPlane {
normal: Vector3;
origin: Vector3;
equation: number[];

constructor(origin: Vector3, normal: Vector3);

isFrontFactingTo(direction: Vector3, epsilon: number): boolean;
signedDistanceTo(point: Vector3): number;

static CreateFromPoints(p1: Vector3, p2: Vector3, p3: Vector3): CollisionPlane;
}
}
17 changes: 17 additions & 0 deletions Typescript/Culling/Octrees/babylon.octree.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/// <reference path="../../babylon.d.ts" />

declare module BABYLON {
class Octree {
blocks: OctreeBlock[];
_maxBlockCapacity: number;
_selection: Tools.SmartArray;

constructor(maxBlockCapacity: number);

update(worldMin: Vector3, worldMax: Vector3, meshes: Mesh[]): void;
addMesh(mesh: Mesh): void;
select(frustrumPlanes: Plane[]): void;

static _CreateBlocks(worldMin: Vector3, worldMax: Vector3, meshes: Mesh[], maxBlockCapacity: number, target: OctreeBlock): void;
}
}
18 changes: 18 additions & 0 deletions Typescript/Culling/Octrees/babylon.octreeBlock.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/// <reference path="../../babylon.d.ts" />

declare module BABYLON {
class OctreeBlock {
subMeshes: Mesh[];
meshes: Mesh[];
_capacity: number;
_minPoint: Vector3;
_maxPoint: Vector3;
_boundingVector: Vector3[];

constructor(minPoint: Vector3, maxPoint: Vector3, capacity: number)

addMesh(mesh: Mesh): void;
addEntries(meshes: Mesh[]): void;
select(frustrumPlanes: Plane[], selection: Tools.SmartArray): void;
}
}
43 changes: 10 additions & 33 deletions Typescript/Culling/babylon.bounding.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,19 @@ declare module BABYLON {
center: Vector3;
extends: Vector3;
directions: Vector3[];
vectorsWorld: Vector3[];
minimumWorld: Vector3;
maximumWorld: Vector3;

constructor(vertices: VertexBuffer, stride: number, start: number, count: number);
constructor(minimum: Vector3, maximum: Vector3);

_update(world: Matrix): void;
isInFrustrum(frustrumPlanes: Plane[]): bool;
intersectsPoint(point: Vector3): bool;

static intersects(box0: BoundingBox, box1: BoundingBox): bool;
}

class BoundingSphere {
minimum: Vector3;
maximum: Vector3;
center: Vector3;
radius: number;

constructor(vertices: VertexBuffer, stride: number, start: number, count: number);

_update(world: Matrix, scale: number): void;
isInFrustrum(frustrumPlanes: Plane[]): bool;
intersectsPoint(point: Vector3): bool;

static intersects(sphere0: BoundingSphere, sphere1: BoundingSphere): bool;
}

class BoundingInfo {
boundingBox: BoundingBox;
boundingSphere: BoundingSphere;

constructor(vertices: VertexBuffer, stride: number, start: number, count: number);

_update(world: Matrix, scale: number): void;
isInFrustrum(frustrumPlanes: Plane[]): bool;
_checkCollision(collider: Collider): bool;
intersectsPoint(point: Vector3): bool;
intersects(boundingInfo: BoundingInfo, precise: bool): bool;
isInFrustrum(frustrumPlanes: Plane[]): boolean;
intersectsPoint(point: Vector3): boolean;
intersectsSphere(sphere: Sphere): boolean;
intersectsMinMax(min: Vector3, max: Vector3): boolean;
IsInFrustrum(boundingVectors: Vector3[], frustrumPlanes: Plane[]): boolean;

static intersects(box0: BoundingBox, box1: BoundingBox): boolean;
}
}
21 changes: 21 additions & 0 deletions Typescript/Culling/babylon.boundingInfo.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/// <reference path="../babylon.d.ts" />

declare module BABYLON {
class BoundingInfo {
boundingBox: BoundingBox;
boundingSphere: BoundingSphere;

constructor(minimum: Vector3, maximum, Vector3);

_update(world: Matrix, scale: number): void;

extentsOverlap(min0, max0, min1, max1): boolean;
computeBoxExtents(axis: Vector3, box: BoundingBox): Object;
axisOverlap(axis: Vector3, box0: BoundingBox, box1: BoundingBox): boolean;
isInFrustrum(frustrumPlanes: Plane[]): boolean;
_checkCollision(collider: Collider): boolean;
intersectsPoint(point: Vector3): boolean;
intersects(boundingInfo: BoundingInfo, precise: boolean): boolean;

}
}
20 changes: 20 additions & 0 deletions Typescript/Culling/babylon.boundingSphere.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/// <reference path="../babylon.d.ts" />

declare module BABYLON {
class BoundingSphere {
minimum: Vector3;
maximum: Vector3;
center: Vector3;
radius: number;
distance: number;
centerWorld: Vector3;

constructor(minimum: Vector3, maximum: Vector3);

_update(world: Matrix, scale: number): void;
isInFrustrum(frustrumPlanes: Plane[]): boolean;
intersectsPoint(point: Vector3): boolean;

static intersects(sphere0: BoundingSphere, sphere1: BoundingSphere): boolean;
}
}
10 changes: 8 additions & 2 deletions Typescript/Layer/babylon.layer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ declare module BABYLON {
class Layer {
name: string;
texture: Texture;
isBackground: bool;
isBackground: boolean;
color: Color4;
_scene: Scene;
vertices: number[];
indicies: number[];
_indexBuffer: IndexBuffer;
_effect: Effect;

constructor(name: string, imgUrl: string, scene: Scene, isBackground: bool);
constructor(name: string, imgUrl: string, scene: Scene, isBackground: boolean, color: Color4);

onDispose: () => void;
render(): void;
Expand Down
22 changes: 22 additions & 0 deletions Typescript/Lights/Shadows/babylon.shadowGenerator.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/// <reference path="../../babylon.d.ts" />

declare module BABYLON {
class ShadowGenerator {
_light: Light;
_scene: Scene;

_shadowMap: RenderTargetTexture;

constructor(mapSize: number, light: Light);

renderSubMesh(subMesh: Mesh): void;

useVarianceShadowMap: boolean;

isReady(mesh: Mesh): boolean;
getShadowMap(): RenderTargetTexture;
getLight(): Light;
getTransformMatrix(): Matrix;
dispose(): void;
}
}
13 changes: 13 additions & 0 deletions Typescript/Lights/babylon.directionalLight.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/// <reference path="../babylon.d.ts" />

declare module BABYLON {
class DirectionalLight extends Light {
direction: Vector3;
animations: Animation[];
position: Vector3;
diffuse: Color3;
specular: Color3;

constructor(name: string, direction: Vector3, scene: Scene);
}
}
15 changes: 15 additions & 0 deletions Typescript/Lights/babylon.hemisphericLight.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/// <reference path="../babylon.d.ts" />

declare module BABYLON {
class HemisphericLight {
direction: Vector3;
diffuse: Color3;
specular: Color3;
groundColor: Color3;
animations: Animation[];

constructor(name: string, direction: Vector3, scene: Scene);

getShadowGenerator(): void;
}
}
21 changes: 4 additions & 17 deletions Typescript/Lights/babylon.light.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,14 @@ declare module BABYLON {
class Light {
name: string;
id: string;
diffuse: Color3;
specular: Color3;
private _scene: Scene;

constructor(name: string, scene: Scene);

intensity: number;
isEnabled: bool;
}

class PointLight extends Light {
position: Vector3;
animations: Animation[];

constructor(name: string, position: Vector3, scene: Scene);
}

class DirectionalLight extends Light {
direction: Vector3;
animations: Animation[];
isEnabled: boolean;

constructor(name: string, direction: Vector3, scene: Scene);
getScene(): Scene;
getShadowGenerator: ShadowGenerator;
dispose(): void;
}
}
12 changes: 12 additions & 0 deletions Typescript/Lights/babylon.pointLight.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/// <reference path="../babylon.d.ts" />

declare module BABYLON {
class PointLight extends Light {
position: Vector3;
diffuse: Color3;
specular: Color3;
animations: Animation[];

constructor(name: string, position: Vector3, scene: Scene)
}
}
15 changes: 15 additions & 0 deletions Typescript/Lights/babylon.spotLight.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/// <reference path="../babylon.d.ts" />

declare module BABYLON {
class SpotLight {
position: Vector3;
direction: Vector3;
angle: number;
exponent: number;
diffuse: Color3;
specular: Color3;
animations: Animation[];

constructor(name: string, position: Vector3, direction: Vector3, angle: number, exponsent: number, scene: Scene);
}
}
12 changes: 8 additions & 4 deletions Typescript/Materials/babylon.effect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,25 @@ declare module BABYLON {

constructor(baseName: string, attributesNames: string[], uniformsNames: string[], samplers: WebGLUniformLocation[], engine: Engine, defines: string);

isReady(): bool;
isReady(): boolean;
getProgram(): WebGLProgram;
getAttribute(index: number): string;
getAttributesNames(): string;
getAttributesCount(): number;
getUniformIndex(uniformName: string): number;
getUniform(uniformName: string): string;
getSamplers(): WebGLUniformLocation[];
getCompilationError(): string;

_prepareEffect(vertexSourceCode: string, fragmentSourceCode: string, attributeNames: string[], defines: string): void;
setTexture(channel: string, texture: Texture): void;
setMatrices(uniformName: string, matrices: Matrix[]): void;
setMatrix(uniformName: string, matrix: Matrix): void;
setBool(uniformName: string, val: bool): void;
setVector2(uniformName: string, x: number, y: number): void;
setBool(uniformName: string, val: boolean): void;
setVector3(uniformName: string, val: Vector3): void;
setVector4(uniformName: string, x: number, y: number, z: number, w: number): void;
setFloat2(uniformName: string, x: number, y: number);
setFloat3(uniformName: string, x: number, y: number, z: number);
setFloat4(uniformName: string, x: number, y: number, z: number, w: number);
setColor3(uniformName: string, color: Color3): void;
setColor4(uniformName: string, color: Color4): void;

Expand Down
Loading

0 comments on commit 76da625

Please sign in to comment.