api objects can no longer be instances of runtime objects

beta.r3js.org
-=yb4f310 2018-01-07 12:58:15 +01:00
parent 5775e1fc58
commit 9ee7b26c1e
67 changed files with 89 additions and 353 deletions

View File

@ -49,66 +49,3 @@ GameLib.API.Color.FromObject = function(objectColor) {
); );
}; };
/**
* Converts the current color to HTML hex format (ex. #ffffff)
* @returns {string}
*/
GameLib.API.Color.prototype.toHex = function() {
if (this.r < 0) {
this.r = 0;
}
if (this.g < 0) {
this.g = 0;
}
if (this.b < 0) {
this.b = 0;
}
if (this.r > 1) {
this.r = 1;
}
if (this.g > 1) {
this.g = 1;
}
if (this.b > 1) {
this.b = 1;
}
var rf = Math.floor(this.r >= 1? 255 : this.r * 256.0).toString(16);
var gf = Math.floor(this.g >= 1? 255 : this.g * 256.0).toString(16);
var bf = Math.floor(this.b >= 1? 255 : this.b * 256.0).toString(16);
if (rf.length < 2) {
rf = '0' + rf;
}
if (gf.length < 2) {
gf = '0' + gf;
}
if (bf.length < 2) {
bf = '0' + bf;
}
return '#' + rf + gf + bf;
};
/**
* Sets this object color to what the hex value is
* @param hex
* @returns {string}
*/
GameLib.API.Color.prototype.fromHex = function(hex) {
var matches = hex.match(new RegExp('#+(..)(..)(..)'));
this.r = parseInt(matches[1], 16) / 255.0;
this.g = parseInt(matches[2], 16) / 255.0;
this.b = parseInt(matches[3], 16) / 255.0;
};

View File

@ -11,10 +11,6 @@ GameLib.Canvas = function(
apiCanvas = {}; apiCanvas = {};
} }
if (apiCanvas instanceof GameLib.Canvas) {
return apiCanvas;
}
GameLib.API.Canvas.call( GameLib.API.Canvas.call(
this, this,
apiCanvas.id, apiCanvas.id,

View File

@ -16,10 +16,6 @@ GameLib.Clock = function(
apiClock = {}; apiClock = {};
} }
if (apiClock instanceof GameLib.Clock) {
return apiClock;
}
GameLib.API.Clock.call( GameLib.API.Clock.call(
this, this,
apiClock.id, apiClock.id,

View File

@ -20,10 +20,6 @@ GameLib.Color = function (
apiColor = {}; apiColor = {};
} }
if (apiColor instanceof GameLib.Color) {
return apiColor;
}
GameLib.API.Color.call( GameLib.API.Color.call(
this, this,
apiColor.r, apiColor.r,
@ -87,3 +83,66 @@ GameLib.Color.prototype.toApiObject = function() {
this.a this.a
); );
}; };
/**
* Converts the current color to HTML hex format (ex. #ffffff)
* @returns {string}
*/
GameLib.Color.prototype.toHex = function() {
if (this.r < 0) {
this.r = 0;
}
if (this.g < 0) {
this.g = 0;
}
if (this.b < 0) {
this.b = 0;
}
if (this.r > 1) {
this.r = 1;
}
if (this.g > 1) {
this.g = 1;
}
if (this.b > 1) {
this.b = 1;
}
var rf = Math.floor(this.r >= 1? 255 : this.r * 256.0).toString(16);
var gf = Math.floor(this.g >= 1? 255 : this.g * 256.0).toString(16);
var bf = Math.floor(this.b >= 1? 255 : this.b * 256.0).toString(16);
if (rf.length < 2) {
rf = '0' + rf;
}
if (gf.length < 2) {
gf = '0' + gf;
}
if (bf.length < 2) {
bf = '0' + bf;
}
return '#' + rf + gf + bf;
};
/**
* Sets this object color to what the hex value is
* @param hex
* @returns {string}
*/
GameLib.Color.prototype.fromHex = function(hex) {
var matches = hex.match(new RegExp('#+(..)(..)(..)'));
this.r = parseInt(matches[1], 16) / 255.0;
this.g = parseInt(matches[2], 16) / 255.0;
this.b = parseInt(matches[3], 16) / 255.0;
};

View File

@ -11,11 +11,7 @@ GameLib.Controls = function (
apiControls = {}; apiControls = {};
} }
if (apiControls instanceof GameLib.Controls) { GameLib.API.Controls.call(
return apiControls;
}
GameLib.API.Controls.call(
this, this,
apiControls.id, apiControls.id,
apiControls.controlsType, apiControls.controlsType,

View File

@ -11,11 +11,7 @@ GameLib.CustomCode = function(
apiCustomCode = {}; apiCustomCode = {};
} }
if (apiCustomCode instanceof GameLib.CustomCode) { GameLib.API.CustomCode.call(
return apiCustomCode;
}
GameLib.API.CustomCode.call(
this, this,
apiCustomCode.id, apiCustomCode.id,
apiCustomCode.name, apiCustomCode.name,

View File

@ -11,11 +11,7 @@ GameLib.D3.Animation = function(
apiAnimation = {}; apiAnimation = {};
} }
if (apiAnimation instanceof GameLib.D3.Animation) { GameLib.D3.API.Animation.call(
return apiAnimation;
}
GameLib.D3.API.Animation.call(
this, this,
apiAnimation.id, apiAnimation.id,
apiAnimation.name, apiAnimation.name,

View File

@ -16,10 +16,6 @@ GameLib.D3.Audio = function(
apiAudio = {}; apiAudio = {};
} }
if (apiAudio instanceof GameLib.D3.Audio) {
return apiAudio;
}
GameLib.D3.API.Audio.call( GameLib.D3.API.Audio.call(
this, this,
apiAudio.id, apiAudio.id,

View File

@ -15,11 +15,7 @@ GameLib.D3.BoneWeight = function (
apiBoneWeight = {}; apiBoneWeight = {};
} }
if (apiBoneWeight instanceof GameLib.D3.BoneWeight) { GameLib.D3.API.BoneWeight.call(
return apiBoneWeight;
}
GameLib.D3.API.BoneWeight.call(
this, this,
apiBoneWeight.boneIndex, apiBoneWeight.boneIndex,
apiBoneWeight.weight apiBoneWeight.weight

View File

@ -15,11 +15,7 @@ GameLib.D3.Bone = function (
apiBone = {}; apiBone = {};
} }
if (apiBone instanceof GameLib.D3.Bone) { GameLib.D3.API.Bone.call(
return apiBone;
}
GameLib.D3.API.Bone.call(
this, this,
apiBone.id, apiBone.id,
apiBone.name, apiBone.name,

View File

@ -16,10 +16,6 @@ GameLib.D3.Broadphase = function (
apiBroadphase = {}; apiBroadphase = {};
} }
if (apiBroadphase instanceof GameLib.D3.Broadphase) {
return apiBroadphase;
}
GameLib.D3.API.Broadphase.call( GameLib.D3.API.Broadphase.call(
this, this,
apiBroadphase.id, apiBroadphase.id,

View File

@ -16,10 +16,6 @@ GameLib.D3.Camera = function(
apiCamera = {}; apiCamera = {};
} }
if (apiCamera instanceof GameLib.D3.Camera) {
return apiCamera;
}
GameLib.D3.API.Camera.call( GameLib.D3.API.Camera.call(
this, this,
apiCamera.id, apiCamera.id,

View File

@ -16,11 +16,7 @@ GameLib.D3.Composer = function (
apiComposer = {}; apiComposer = {};
} }
if (apiComposer instanceof GameLib.D3.Composer) { GameLib.D3.API.Composer.call(
return apiComposer;
}
GameLib.D3.API.Composer.call(
this, this,
apiComposer.id, apiComposer.id,
apiComposer.name, apiComposer.name,

View File

@ -22,10 +22,6 @@ GameLib.D3.Face = function Face(
apiFace = {}; apiFace = {};
} }
if (apiFace instanceof GameLib.D3.Face) {
return apiFace;
}
GameLib.D3.API.Face.call( GameLib.D3.API.Face.call(
this, this,
apiFace.id, apiFace.id,

View File

@ -16,11 +16,7 @@ GameLib.D3.Fog = function (
apiFog = {}; apiFog = {};
} }
if (apiFog instanceof GameLib.D3.Fog) { GameLib.D3.API.Fog.call(
return apiFog;
}
GameLib.D3.API.Fog.call(
this, this,
apiFog.id, apiFog.id,
apiFog.name, apiFog.name,

View File

@ -15,10 +15,6 @@ GameLib.D3.Font = function(
apiFont = {}; apiFont = {};
} }
if (apiFont instanceof GameLib.D3.Font) {
return apiFont;
}
GameLib.D3.API.Font.call( GameLib.D3.API.Font.call(
this, this,
apiFont.id, apiFont.id,

View File

@ -16,10 +16,6 @@ GameLib.D3.FrictionContactMaterial = function (
apiFrictionContactMaterial = {}; apiFrictionContactMaterial = {};
} }
if (apiFrictionContactMaterial instanceof GameLib.D3.FrictionContactMaterial) {
return apiFrictionContactMaterial;
}
GameLib.D3.API.FrictionContactMaterial.call( GameLib.D3.API.FrictionContactMaterial.call(
this, this,
apiFrictionContactMaterial.id, apiFrictionContactMaterial.id,

View File

@ -16,10 +16,6 @@ GameLib.D3.FrictionMaterial = function (
apiFrictionMaterial = {}; apiFrictionMaterial = {};
} }
if (apiFrictionMaterial instanceof GameLib.D3.FrictionMaterial) {
return apiFrictionMaterial;
}
GameLib.D3.API.FrictionMaterial.call( GameLib.D3.API.FrictionMaterial.call(
this, this,
apiFrictionMaterial.id, apiFrictionMaterial.id,

View File

@ -15,10 +15,6 @@ GameLib.D3.Light = function(
apiLight = {}; apiLight = {};
} }
if (apiLight instanceof GameLib.D3.Light) {
return apiLight;
}
GameLib.D3.API.Light.call( GameLib.D3.API.Light.call(
this, this,
apiLight.id, apiLight.id,

View File

@ -18,11 +18,7 @@ GameLib.D3.Material = function(
apiMaterial = {}; apiMaterial = {};
} }
if (apiMaterial instanceof GameLib.D3.Material) { GameLib.D3.API.Material.call(
return apiMaterial;
}
GameLib.D3.API.Material.call(
this, this,
apiMaterial.id, apiMaterial.id,
apiMaterial.materialType, apiMaterial.materialType,

View File

@ -17,11 +17,7 @@ GameLib.D3.Mesh = function (
}; };
} }
if (apiMesh instanceof GameLib.D3.Mesh) { GameLib.D3.API.Mesh.call(
return apiMesh;
}
GameLib.D3.API.Mesh.call(
this, this,
apiMesh.id, apiMesh.id,
apiMesh.meshType, apiMesh.meshType,

View File

@ -23,10 +23,6 @@ GameLib.D3.Mesh.Box = function (
}; };
} }
if (apiMesh instanceof GameLib.D3.Mesh.Box) {
return apiMesh;
}
if (GameLib.Utils.UndefinedOrNull(width)) { if (GameLib.Utils.UndefinedOrNull(width)) {
width = 1; width = 1;
} }

View File

@ -17,10 +17,6 @@ GameLib.D3.Mesh.Curve = function (
}; };
} }
if (apiMesh instanceof GameLib.D3.Mesh.Curve) {
return apiMesh;
}
GameLib.D3.Mesh.call( GameLib.D3.Mesh.call(
this, this,
this.graphics, this.graphics,

View File

@ -34,10 +34,6 @@ GameLib.D3.Mesh.Cylinder = function (
}; };
} }
if (apiMesh instanceof GameLib.D3.Mesh.Cylinder) {
return apiMesh;
}
if (GameLib.Utils.UndefinedOrNull(radiusTop)) { if (GameLib.Utils.UndefinedOrNull(radiusTop)) {
radiusTop = 1; radiusTop = 1;
} }

View File

@ -19,10 +19,6 @@ GameLib.D3.Mesh.Line = function (
}; };
} }
if (apiMesh instanceof GameLib.D3.Mesh.Line) {
return apiMesh;
}
if (GameLib.Utils.UndefinedOrNull(lineWidth)) { if (GameLib.Utils.UndefinedOrNull(lineWidth)) {
lineWidth = 1; lineWidth = 1;
} }

View File

@ -23,10 +23,6 @@ GameLib.D3.Mesh.Sphere = function (
}; };
} }
if (apiMesh instanceof GameLib.D3.Mesh.Sphere) {
return apiMesh;
}
if (GameLib.Utils.UndefinedOrNull(radius)) { if (GameLib.Utils.UndefinedOrNull(radius)) {
radius = 1; radius = 1;
} }

View File

@ -35,10 +35,6 @@ GameLib.D3.Mesh.Text = function (
}; };
} }
if (apiMesh instanceof GameLib.D3.Mesh.Text) {
return apiMesh;
}
if (GameLib.Utils.UndefinedOrNull(text)) { if (GameLib.Utils.UndefinedOrNull(text)) {
text = '-=<yb4f310'; text = '-=<yb4f310';
} }

View File

@ -16,10 +16,6 @@ GameLib.D3.ParticleEngine = function(
apiParticleEngine = {}; apiParticleEngine = {};
} }
if (apiParticleEngine instanceof GameLib.D3.ParticleEngine) {
return apiParticleEngine;
}
GameLib.D3.API.ParticleEngine.call( GameLib.D3.API.ParticleEngine.call(
this, this,
apiParticleEngine.id, apiParticleEngine.id,

View File

@ -16,10 +16,6 @@ GameLib.D3.Particle = function(
apiParticle = {}; apiParticle = {};
} }
if (apiParticle instanceof GameLib.D3.Particle) {
return apiParticle;
}
GameLib.D3.API.Particle.call( GameLib.D3.API.Particle.call(
this, this,
apiParticle.id, apiParticle.id,

View File

@ -16,11 +16,7 @@ GameLib.D3.Pass = function (
apiPass = {}; apiPass = {};
} }
if (apiPass instanceof GameLib.D3.Pass) { GameLib.D3.API.Pass.call(
return apiPass;
}
GameLib.D3.API.Pass.call(
this, this,
apiPass.id, apiPass.id,
apiPass.name, apiPass.name,

View File

@ -16,10 +16,6 @@ GameLib.D3.PhysicsWorld = function(
apiWorld = {}; apiWorld = {};
} }
if (apiWorld instanceof GameLib.D3.PhysicsWorld) {
return apiWorld;
}
GameLib.D3.API.PhysicsWorld.call( GameLib.D3.API.PhysicsWorld.call(
this, this,
apiWorld.id, apiWorld.id,

View File

@ -16,10 +16,6 @@ GameLib.D3.RaycastVehicle = function (
apiRaycastVehicle = {}; apiRaycastVehicle = {};
} }
if (apiRaycastVehicle instanceof GameLib.D3.RaycastVehicle) {
return apiRaycastVehicle;
}
GameLib.D3.API.RaycastVehicle.call( GameLib.D3.API.RaycastVehicle.call(
this, this,
apiRaycastVehicle.id, apiRaycastVehicle.id,

View File

@ -16,10 +16,6 @@ GameLib.D3.RaycastWheel = function (
apiRaycastWheel = {}; apiRaycastWheel = {};
} }
if (apiRaycastWheel instanceof GameLib.D3.RaycastWheel) {
return apiRaycastWheel;
}
GameLib.D3.API.RaycastWheel.call( GameLib.D3.API.RaycastWheel.call(
this, this,
apiRaycastWheel.id, apiRaycastWheel.id,

View File

@ -16,11 +16,7 @@ GameLib.D3.Raycaster = function(
apiRaycaster = {}; apiRaycaster = {};
} }
if (apiRaycaster instanceof GameLib.D3.Raycaster) { GameLib.D3.API.Raycaster.call(
return apiRaycaster;
}
GameLib.D3.API.Raycaster.call(
this, this,
apiRaycaster.id, apiRaycaster.id,
apiRaycaster.name, apiRaycaster.name,

View File

@ -16,11 +16,7 @@ GameLib.D3.RenderTarget = function (
apiRenderTarget = {}; apiRenderTarget = {};
} }
if (apiRenderTarget instanceof GameLib.D3.RenderTarget) { GameLib.D3.API.RenderTarget.call(
return apiRenderTarget;
}
GameLib.D3.API.RenderTarget.call(
this, this,
apiRenderTarget.id, apiRenderTarget.id,
apiRenderTarget.name, apiRenderTarget.name,

View File

@ -16,11 +16,7 @@ GameLib.D3.Renderer = function (
apiRenderer = {}; apiRenderer = {};
} }
if (apiRenderer instanceof GameLib.D3.Renderer) { GameLib.D3.API.Renderer.call(
return apiRenderer;
}
GameLib.D3.API.Renderer.call(
this, this,
apiRenderer.id, apiRenderer.id,
apiRenderer.name, apiRenderer.name,

View File

@ -16,10 +16,6 @@ GameLib.D3.RigidBody = function (
apiRigidBody = {}; apiRigidBody = {};
} }
if (apiRigidBody instanceof GameLib.D3.RigidBody) {
return apiRigidBody;
}
GameLib.D3.API.RigidBody.call( GameLib.D3.API.RigidBody.call(
this, this,
apiRigidBody.id, apiRigidBody.id,

View File

@ -16,11 +16,7 @@ GameLib.D3.Scene = function (
apiScene = {}; apiScene = {};
} }
if (apiScene instanceof GameLib.D3.Scene) { GameLib.D3.API.Scene.call(
return apiScene;
}
GameLib.D3.API.Scene.call(
this, this,
apiScene.id, apiScene.id,
apiScene.name, apiScene.name,

View File

@ -17,11 +17,7 @@ GameLib.D3.Shape = function (
}; };
} }
if (apiShape instanceof GameLib.D3.Shape) { GameLib.D3.API.Shape.call(
return apiShape;
}
GameLib.D3.API.Shape.call(
this, this,
apiShape.id, apiShape.id,
apiShape.name, apiShape.name,

View File

@ -19,10 +19,6 @@ GameLib.D3.Shape.Box = function (
}; };
} }
if (apiShape instanceof GameLib.D3.Shape.Box) {
return apiShape;
}
if (GameLib.Utils.UndefinedOrNull(halfExtents)) { if (GameLib.Utils.UndefinedOrNull(halfExtents)) {
halfExtents = new GameLib.Vector3( halfExtents = new GameLib.Vector3(
physics, physics,

View File

@ -25,10 +25,6 @@ GameLib.D3.Shape.ConvexHull = function (
}; };
} }
if (apiShape instanceof GameLib.D3.Shape.ConvexHull) {
return apiShape;
}
if (GameLib.Utils.UndefinedOrNull(vertices)) { if (GameLib.Utils.UndefinedOrNull(vertices)) {
vertices = []; vertices = [];
} }

View File

@ -25,10 +25,6 @@ GameLib.D3.Shape.ConvexHull.Cylinder = function (
}; };
} }
if (apiShape instanceof GameLib.D3.Shape.ConvexHull.Cylinder) {
return apiShape;
}
if (GameLib.Utils.UndefinedOrNull(radiusTop)) { if (GameLib.Utils.UndefinedOrNull(radiusTop)) {
radiusTop = 1; radiusTop = 1;
} }

View File

@ -25,10 +25,6 @@ GameLib.D3.Shape.HeightMap = function (
}; };
} }
if (apiShape instanceof GameLib.D3.Shape.HeightMap) {
return apiShape;
}
if (GameLib.Utils.UndefinedOrNull(heightData)) { if (GameLib.Utils.UndefinedOrNull(heightData)) {
heightData = [[10, 10, 10], [10, 10, 10], [10, 10, 10]]; heightData = [[10, 10, 10], [10, 10, 10], [10, 10, 10]];
} }

View File

@ -17,10 +17,6 @@ GameLib.D3.Shape.Plane = function (
}; };
} }
if (apiShape instanceof GameLib.D3.Shape.Plane) {
return apiShape;
}
GameLib.D3.Shape.call( GameLib.D3.Shape.call(
this, this,
this.physics, this.physics,

View File

@ -19,10 +19,6 @@ GameLib.D3.Shape.Sphere = function (
}; };
} }
if (apiShape instanceof GameLib.D3.Shape.Sphere) {
return apiShape;
}
if (GameLib.Utils.UndefinedOrNull(radius)) { if (GameLib.Utils.UndefinedOrNull(radius)) {
radius = 1; radius = 1;
} }

View File

@ -21,10 +21,6 @@ GameLib.D3.Shape.TriMesh = function (
}; };
} }
if (apiShape instanceof GameLib.D3.Shape.TriMesh) {
return apiShape;
}
if (GameLib.Utils.UndefinedOrNull(vertices)) { if (GameLib.Utils.UndefinedOrNull(vertices)) {
vertices = []; vertices = [];
} }

View File

@ -15,11 +15,7 @@ GameLib.D3.Skeleton = function Skeleton(
apiSkeleton = {}; apiSkeleton = {};
} }
if (apiSkeleton instanceof GameLib.D3.Skeleton) { GameLib.D3.API.Skeleton.call(
return apiSkeleton;
}
GameLib.D3.API.Skeleton.call(
this, this,
apiSkeleton.id, apiSkeleton.id,
apiSkeleton.name, apiSkeleton.name,

View File

@ -16,10 +16,6 @@ GameLib.D3.Solver = function (
apiSolver = {}; apiSolver = {};
} }
if (apiSolver instanceof GameLib.D3.Solver) {
return apiSolver;
}
GameLib.D3.API.Solver.call( GameLib.D3.API.Solver.call(
this, this,
apiSolver.id, apiSolver.id,

View File

@ -15,11 +15,7 @@ GameLib.D3.Spline = function (
apiSpline = {}; apiSpline = {};
} }
if (apiSpline instanceof GameLib.D3.Spline) { GameLib.D3.API.Spline.call(
return apiSpline;
}
GameLib.D3.API.Spline.call(
this, this,
apiSpline.id, apiSpline.id,
apiSpline.name, apiSpline.name,

View File

@ -16,11 +16,7 @@ GameLib.D3.Texture = function(
apiTexture = {}; apiTexture = {};
} }
if (apiTexture instanceof GameLib.D3.Texture) { GameLib.D3.API.Texture.call(
return apiTexture;
}
GameLib.D3.API.Texture.call(
this, this,
apiTexture.id, apiTexture.id,
apiTexture.textureType, apiTexture.textureType,

View File

@ -21,10 +21,6 @@ GameLib.D3.Vertex = function Vertex(
apiVertex = {}; apiVertex = {};
} }
if (apiVertex instanceof GameLib.D3.Vertex) {
return apiVertex;
}
GameLib.D3.API.Vertex.call( GameLib.D3.API.Vertex.call(
this, this,
apiVertex.position, apiVertex.position,

View File

@ -16,11 +16,7 @@ GameLib.D3.Viewport = function (
apiViewport = {}; apiViewport = {};
} }
if (apiViewport instanceof GameLib.D3.Viewport) { GameLib.D3.API.Viewport.call(
return apiViewport;
}
GameLib.D3.API.Viewport.call(
this, this,
apiViewport.id, apiViewport.id,
apiViewport.name, apiViewport.name,

View File

@ -9,10 +9,6 @@ GameLib.DomElement = function (apiDomElement) {
apiDomElement = {}; apiDomElement = {};
} }
if (apiDomElement instanceof GameLib.DomElement) {
return apiDomElement;
}
GameLib.API.DomElement.call( GameLib.API.DomElement.call(
this, this,
apiDomElement.id, apiDomElement.id,

View File

@ -8,10 +8,6 @@ GameLib.EntityManager = function(apiEntityManager) {
apiEntityManager = {}; apiEntityManager = {};
} }
if (apiEntityManager instanceof GameLib.EntityManager) {
return apiEntityManager;
}
GameLib.API.EntityManager.call( GameLib.API.EntityManager.call(
this, this,
apiEntityManager.id, apiEntityManager.id,

View File

@ -10,11 +10,7 @@ GameLib.Entity = function (
apiEntity = {}; apiEntity = {};
} }
if (apiEntity instanceof GameLib.Entity) { GameLib.API.Entity.call(
return apiEntity;
}
GameLib.API.Entity.call(
this, this,
apiEntity.id, apiEntity.id,
apiEntity.name, apiEntity.name,

View File

@ -15,10 +15,6 @@ GameLib.GUI = function(
apiGUI = {}; apiGUI = {};
} }
if (apiGUI instanceof GameLib.GUI) {
return apiGUI;
}
GameLib.API.GUI.call( GameLib.API.GUI.call(
this, this,
apiGUI.id, apiGUI.id,

View File

@ -11,10 +11,6 @@ GameLib.Image = function(
apiImage = {}; apiImage = {};
} }
if (apiImage instanceof GameLib.Image) {
return apiImage;
}
GameLib.API.Image.call( GameLib.API.Image.call(
this, this,
apiImage.id, apiImage.id,

View File

@ -20,11 +20,7 @@ GameLib.Matrix4 = function(
apiMatrix4 = {}; apiMatrix4 = {};
} }
if (apiMatrix4 instanceof GameLib.Matrix4) { GameLib.API.Matrix4.call(
return apiMatrix4;
}
GameLib.API.Matrix4.call(
this, this,
apiMatrix4.rows[0], apiMatrix4.rows[0],
apiMatrix4.rows[1], apiMatrix4.rows[1],

View File

@ -10,11 +10,7 @@ GameLib.Mouse = function (apiMouse) {
apiMouse = {}; apiMouse = {};
} }
if (apiMouse instanceof GameLib.Mouse) { GameLib.API.Mouse.call(
return apiMouse;
}
GameLib.API.Mouse.call(
this, this,
apiMouse.id, apiMouse.id,
apiMouse.name, apiMouse.name,

View File

@ -30,11 +30,7 @@ GameLib.Quaternion = function (
apiQuaternion = {}; apiQuaternion = {};
} }
if (apiQuaternion instanceof GameLib.Quaternion) { GameLib.API.Quaternion.call(
return apiQuaternion;
}
GameLib.API.Quaternion.call(
this, this,
apiQuaternion.x, apiQuaternion.x,
apiQuaternion.y, apiQuaternion.y,

View File

@ -11,10 +11,6 @@ GameLib.Server = function(
apiServer = {}; apiServer = {};
} }
if (apiServer instanceof GameLib.Server) {
return apiServer;
}
GameLib.API.Server.call( GameLib.API.Server.call(
this, this,
apiServer.id, apiServer.id,

View File

@ -16,10 +16,6 @@ GameLib.Socket = function(
apiSocket = {}; apiSocket = {};
} }
if (apiSocket instanceof GameLib.Socket) {
return apiSocket;
}
GameLib.API.Socket.call( GameLib.API.Socket.call(
this, this,
apiSocket.id, apiSocket.id,

View File

@ -15,10 +15,6 @@ GameLib.Stats = function(
apiStats = {}; apiStats = {};
} }
if (apiStats instanceof GameLib.Stats) {
return apiStats;
}
GameLib.API.Stats.call( GameLib.API.Stats.call(
this, this,
apiStats.id, apiStats.id,

View File

@ -11,11 +11,7 @@ GameLib.System = function(
apiSystem = {}; apiSystem = {};
} }
if (apiSystem instanceof GameLib.System) { GameLib.API.System.call(
return apiSystem;
}
GameLib.API.System.call(
this, this,
apiSystem.id, apiSystem.id,
apiSystem.name, apiSystem.name,

View File

@ -20,11 +20,7 @@ GameLib.Vector2 = function (
apiVector2 = {}; apiVector2 = {};
} }
if (apiVector2 instanceof GameLib.Vector2) { GameLib.API.Vector2.call(
return apiVector2;
}
GameLib.API.Vector2.call(
this, this,
apiVector2.x, apiVector2.x,
apiVector2.y apiVector2.y

View File

@ -31,11 +31,7 @@ GameLib.Vector3 = function (
apiVector3 = {}; apiVector3 = {};
} }
if (apiVector3 instanceof GameLib.Vector3) { GameLib.API.Vector3.call(
return apiVector3;
}
GameLib.API.Vector3.call(
this, this,
apiVector3.x, apiVector3.x,
apiVector3.y, apiVector3.y,

View File

@ -20,10 +20,6 @@ GameLib.Vector4 = function (
apiVector4 = {}; apiVector4 = {};
} }
if (apiVector4 instanceof GameLib.Vector4) {
return apiVector4;
}
GameLib.API.Vector4.call( GameLib.API.Vector4.call(
this, this,
apiVector4.x, apiVector4.x,