Michuspo Posted July 30, 2017 Share Posted July 30, 2017 Hi, I'm using BabylonJS in an Angular project. I used NPM and I have installed 3.0.7: "babylonjs": "^3.0.7", I think the definition file is uncompleted, because a lot of properties are not available, like: camera.alpha But it happens in others properties, in materials, ..... Inside my node_module folder: What do you think can be the problem? Thanks! Quote Link to comment Share on other sites More sharing options...
brianzinn Posted July 30, 2017 Share Posted July 30, 2017 I think only ArcRotateCamera (and derived cameras - ie: AnaglyphArcRotateCamera) have alpha/beta is that the one you are using?http://doc.babylonjs.com/classes/3.0/arcrotatecamera Quote Link to comment Share on other sites More sharing options...
Michuspo Posted July 31, 2017 Author Share Posted July 31, 2017 Thanks Brianzinn for your answer. Yes, I'm using alpha in ArcRotateCamera, but it happens me with Materials too: //Creation of a mirror material var mirrorMaterial = new BABYLON.StandardMaterial("texture4", this._scene); mirrorMaterial.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4); mirrorMaterial.reflectionTexture = new BABYLON.MirrorTexture("mirror", 512, this._scene, true); //Create a mirror texture mirrorMaterial.reflectionTexture.mirrorPlane = new BABYLON.Plane(0, -1.0, 0, -10.0); Property 'mirrorPlane' does not exist on type 'BaseTexture' Another example: //Wall var wall = BABYLON.Mesh.CreatePlane("wall", 20.0, this._scene); wall.material = new BABYLON.StandardMaterial("wallMat", this._scene); wall.material.emissiveColor = new BABYLON.Color3(0.5, 1, 0.5); Property 'emissiveColor' does not exist on type 'Material'. Any idea about can be the problem? Thanks, Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 31, 2017 Share Posted July 31, 2017 This is weird because the d.ts is always in sync. I think more as an issue in your code: mirrorMaterial.reflectionTexture = new BABYLON.MirrorTexture("mirror", 512, this._scene, true); //Create a mirror texture mirrorMaterial.reflectionTexture.mirrorPlane = new BABYLON.Plane(0, -1.0, 0, -10.0); the complain from the compiler is fine. the reflectionTexture is flagged as BaseTexture. You should first cast it to MirrorTexture. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted July 31, 2017 Share Posted July 31, 2017 (edited) I'm using same version of BabylonJS. If I right-click on emissive color in editor and go to definition, it brings me right to: class StandardMaterial extends PushMaterial { ... emissiveColor: Color3; (line 6060 of babylon.module.d.ts) } Not all materials support emissive color - StandardMaterial does. Might be a code issue. var wallMaterial = new BABYLON.StandardMaterial("wallMat", this._scene); wallMaterial.emissiveColor = new BABYLON.Color3(0.5, 1, 0.5); wall.material = wallMaterial Edited July 31, 2017 by brianzinn add code sample Quote Link to comment Share on other sites More sharing options...
Michuspo Posted August 2, 2017 Author Share Posted August 2, 2017 Hi, Sorry, I'm still working on that without success! I have a code that it is running in the playground: https://playground.babylonjs.com/#GWK0TQ#8 I'm trying to have the same in my Angular project. I have two problems: 1) Camera.Alpha: light.position.x = Math.cos(this._camera.alpha + radiansFromCameraForShadows) * 10 2) BABYLON.GridMaterial var grid = new BABYLON.GridMaterial("grid", this._scene); What BJS version is running the playground? I was checking my installation and everything looks ok. Even, in the case of camera.alpha, I was checking the ts file, and it is there: declare module BABYLON { class ArcRotateCamera extends TargetCamera { alpha: number; beta: number; radius: number; Thanks for your help! Quote Link to comment Share on other sites More sharing options...
Michuspo Posted August 2, 2017 Author Share Posted August 2, 2017 Hi guys! Camera issue is fixed! Camera was out of scope! Thanks! GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.