MackeyK24

Members
  • Content Count

    1166
  • Joined

  • Last visited

  • Days Won

    8

Reputation Activity

  1. Thanks
    MackeyK24 got a reaction from usoban in Quaternion.LookRotation Implementation   
    Thanks Bro... I am gonna try these Util Function in my toolkit Managed API
     
    /** Returns a new Quaternion set from the passed vector position. */ public static LookRotation(position:BABYLON.Vector3):BABYLON.Quaternion { var result:BABYLON.Quaternion = BABYLON.Quaternion.Zero(); BABYLON.Utilities.LookRotationToRef(position, result); return result; } /** Returns a new Quaternion set from the passed vector position. */ public static LookRotationToRef(position:BABYLON.Vector3, result:BABYLON.Quaternion):void { BABYLON.Utilities.TempMatrix.reset(); BABYLON.Matrix.LookAtLHToRef(BABYLON.Utilities.ZeroVector, position, BABYLON.Utilities.UpVector, BABYLON.Utilities.TempMatrix) BABYLON.Utilities.TempMatrix.invert() BABYLON.Quaternion.FromRotationMatrixToRef(BABYLON.Utilities.TempMatrix, result); }  
  2. Like
    MackeyK24 got a reaction from ParadoxMaster in How to export mesh instances and mesh clones from Unity ?   
    The prefab system is the core tech behind this kind of thing. You have a couple ways of doing this type of thing using prefabs.
    1... Manually create instances from prefab meshes
    2... Use the built in Tree 🌲 system I made to support Terrains (not complete because I could never get anyone to help me write the terrain shader all the way)
    I’m sorry, I have company visiting me this week. But when I get a chance I’ll try make a quick video showing the Terrain and Tree  Painting so you can use the Editor to scatter trees over the terrain . Including Tree LOD’s
  3. Like
    MackeyK24 got a reaction from trevordev in Demo with Ammo.js Physics Engine   
    Thank goodness 😄
  4. Like
    MackeyK24 got a reaction from Sebavan in Demo with Ammo.js Physics Engine   
    Thank goodness 😄
  5. Like
    MackeyK24 got a reaction from Deltakosh in GLTF Importer De-Parenting Skinned Meshes   
    Holy crap.... Somebody did ALOT of work on that new inspector... Looks Freaking awesome
     
  6. Like
    MackeyK24 got a reaction from bghgary in GLTF Importer De-Parenting Skinned Meshes   
    Thanks Gary... Parenting works great now
     
  7. Like
    MackeyK24 got a reaction from ninespace in BabylonJS Toolkit Problems   
    You can literally HOST that Export folder as in IIS / ASP.NET
    There are so many options... The toolkit itself HOST the export every time you hit build and preview... IT ALSO SUPPORTS Serving compressed content... Just look at the Web Browser Network Panel... On eof the columns shows the actual gzipped size that is transfer.
    You could just Copy the Export folder to a hosting company like GODADDY... The bin folder has the HttpModule if you have that selected to export... and it generates the web.conifg that associates all the scene content stuff.
    Dude... If you are using My Toolkit... You are literally ready to rock and roll for web release
    Just HOST the Export folder somewhere (When not using the Toolkit for development)
     
  8. Thanks
    MackeyK24 got a reaction from ninespace in BabylonJS Toolkit Problems   
    You would use the SceneManager findSceneComponent function to find ANY component class on the specified OWER GAME OBJECT
    So for Example if i want t o get a reference to the BABYLON.AnimationState component that is on an OWNER GAME OBJECT
    let animator:BABYLON.AnimationState = this.manager.findSceneComponent("BABYLON.AnimationState", this.ownerMesh);  
    If you are trying to get a reference to a component from a script that is ALSO on the same OWNER GAME OBJECT
    let animator:BABYLON.AnimationState = this.getComponent("BABYLON.AnimationState");  
    So to get a reference to Another Script Component on the SAME OWNER... Use this.getComponent... And to be to get a component from ANY game object use this.manager.findSceneComponent

    To Get Custom Script just use your for class name:
    let myComp = this.getComponent("PROJECT.MyScriptComponent"); myComp.ExampleMethodCall("blah");  
    Here is an example old ThirdPersonController script... Just take a look how i get references to OTHER Script Components
    protected ready() :void { // Setup animation state component this.animator = this.getComponent("BABYLON.AnimationState"); if (this.animator == null) { BABYLON.Tools.Warn("Failed to locate animation state for: " + this.mesh.name); } else { // Disable Auto-Ticking this.animator.autoTicking = false; } // Setup character controller component this.character = this.getComponent("BABYLON.CharacterController"); if (this.character == null) { BABYLON.Tools.Warn("Failed to locate character controller for: " + this.mesh.name); } else { this.baseFriction = this.character.getFriction(); this.frictionLevel = this.baseFriction; } }  
    Complete ThirdPersonController Example Script:
    /* Babylon Mesh Component Template */ module BABYLON { export enum ThirdPersonLocomotion { Idle = 0, Walk = 1, Run = 2, Sprint = 3 } export enum ThirdPersonCameraShoulder { Right = 0, Left = 1 } export class ThirdPersonCameraSettings { public positionLeft:BABYLON.Vector3 = BABYLON.Vector3.Zero(); public positionRight:BABYLON.Vector3 = BABYLON.Vector3.Zero(); public lookXSensitivity:number = 2.5; public lookYSensitivity:number = 2.5; public minimumAngle:number = -30.0; public maximumAngle:number = 60.0; public rotationSpeed:number = 5.0; public fieldOfView:number = 70.0; public zoomFieldOfView:number = 30.0; public zooomSpeed:number = 3.0; public hideMeshDistance:number = 0.5; public movementLerpSpeed:number = 2.0; } export class ThirdPersonController extends BABYLON.MeshComponent { public movementVector:BABYLON.Vector3 = BABYLON.Vector3.Zero(); public runSpeed:number = 2.0; public walkSpeed:number = 1.0; public turnSpeed:number = 1.0; public jumpSpeed:number = 5.0; public sprintSpeed:number = 3.0; public enableInput:boolean = false; public rootMotion:boolean = false; public animator:BABYLON.AnimationState = null; public character:BABYLON.CharacterController = null; public cameraRig:BABYLON.AbstractMesh = null; public cameraPivot:BABYLON.AbstractMesh = null; public cameraSphere:BABYLON.AbstractMesh = null; public freeCamera:BABYLON.FreeCamera = null; public buttonJump:number = BABYLON.Xbox360Button.A; public keyboardJump:number = BABYLON.UserInputKey.SpaceBar; public buttonSprint:number = BABYLON.Xbox360Button.LeftStick; public keyboardSprint:number = BABYLON.UserInputKey.Shift; public buttonShoulder:number = BABYLON.Xbox360Button.Y; public keyboardShoulder:number = BABYLON.UserInputKey.Y; public baseFriction:number = 0.01; public frictionLevel:number = 0.0; public wheelInput:number = 0.0; public mouseXInput:number = 0.0; public mouseYInput:number = 0.0; public verticalInput:number = 0.0; public horizontalInput:number = 0.0; public cameraSettings:BABYLON.ThirdPersonCameraSettings = null; //public currentVelocity:BABYLON.Vector3 = BABYLON.Vector3.Zero(); //public currentDirection:BABYLON.ThirdPersonDirection = BABYLON.ThirdPersonDirection.Stationary; //public jumpingDirection:BABYLON.ThirdPersonDirection = BABYLON.ThirdPersonDirection.Stationary; public locomotionState:BABYLON.ThirdPersonLocomotion = BABYLON.ThirdPersonLocomotion.Idle; public locomotionSpeed:number = 0.0; private _meshRotator:BABYLON.MeshRotator = null; private _cameraRotation:BABYLON.Quaternion = BABYLON.Quaternion.Zero(); private _cameraRotationX:number = 0.0; private _cameraRotationY:number = 0.0; private _autoActivateCamera:boolean = false; private _isCharacterJumping:boolean = false; private _isCharacterFalling:boolean = false; private _isCharacterSliding:boolean = false; private _isCharacterGrounded:boolean = false; private _isCharacterCrouched:boolean = false; private _isCharacterJumpFrame:boolean = false; private _inputMoveSpeed:number = 0.0; private _inputMoveVector:BABYLON.Vector3 = BABYLON.Vector3.Zero(); private _meshEulerAngles:BABYLON.Vector3 = BABYLON.Vector3.Zero(); private _pivotEulerAngles:BABYLON.Vector3 = BABYLON.Vector3.Zero(); private _cameraDestination:BABYLON.Vector3 = BABYLON.Vector3.Zero(); private _followCameraOffset:BABYLON.Vector3 = BABYLON.Vector3.Zero(); private _followCameraShoulder:BABYLON.ThirdPersonCameraShoulder = BABYLON.ThirdPersonCameraShoulder.Right; public constructor(owner: BABYLON.AbstractMesh, scene: BABYLON.Scene, tick: boolean = true, propertyBag: any = {}) { super(owner, scene, tick, propertyBag); this._meshRotator = new BABYLON.MeshRotator(this.mesh); this._autoActivateCamera = this.getProperty("activateCamera", false); this.enableInput = this.getProperty("enableInput", false); this.rootMotion = this.getProperty("rootMotion", false); this.cameraSettings = new BABYLON.ThirdPersonCameraSettings(); // Built-In Follow Camera Options var cameraOptions:any = this.getProperty("cameraOptions") if (cameraOptions != null) { this.cameraSettings.lookXSensitivity = cameraOptions.lookXSensitivity; this.cameraSettings.lookYSensitivity = cameraOptions.lookYSensitivity; this.cameraSettings.minimumAngle = cameraOptions.minimumAngle; this.cameraSettings.maximumAngle = cameraOptions.maximumAngle; this.cameraSettings.rotationSpeed = cameraOptions.rotationSpeed; this.cameraSettings.fieldOfView = cameraOptions.fieldOfView; this.cameraSettings.zoomFieldOfView = cameraOptions.zoomFieldOfView; this.cameraSettings.zooomSpeed = cameraOptions.zooomSpeed; this.cameraSettings.hideMeshDistance = cameraOptions.hideMeshDistance; this.cameraSettings.movementLerpSpeed = cameraOptions.movementLerpSpeed; } // Built-In Follow Camera Position var cameraPosition:any = this.getProperty("cameraPosition") this.cameraSettings.positionRight = BABYLON.Utilities.ParseVector3(cameraPosition, new BABYLON.Vector3(0.75, 1.0, -2.5)); this.cameraSettings.positionLeft = new BABYLON.Vector3(-this.cameraSettings.positionRight.y, this.cameraSettings.positionRight.y, this.cameraSettings.positionRight.z); // Built-In Motor Options Support var motorProperties:any = this.getProperty("motorProperties") if (motorProperties != null) { this.runSpeed = motorProperties.runSpeed; this.walkSpeed = motorProperties.walkSpeed; this.turnSpeed = motorProperties.turnSpeed; this.jumpSpeed = motorProperties.jumpSpeed; this.sprintSpeed = motorProperties.sprintSpeed; } } protected ready() :void { // Setup animation state component this.animator = this.getComponent("BABYLON.AnimationState"); if (this.animator == null) { BABYLON.Tools.Warn("Failed to locate animation state for: " + this.mesh.name); } else { // Disable Auto-Ticking this.animator.autoTicking = false; } // Setup character conntroller component this.character = this.getComponent("BABYLON.CharacterController"); if (this.character == null) { BABYLON.Tools.Warn("Failed to locate character controller for: " + this.mesh.name); } else { this.baseFriction = this.character.getFriction(); this.frictionLevel = this.baseFriction; } // Setup character quaternion rotations if (this.mesh.rotationQuaternion == null) this.mesh.rotationQuaternion = BABYLON.Utilities.Euler(this.mesh.rotation.x, this.mesh.rotation.y, this.mesh.rotation.z); // Setup character controller camera rig this.cameraRig = new BABYLON.Mesh(this.mesh + "CameraRig", this.scene); this.cameraRig.position = this.mesh.position.clone(); if (this.cameraRig.rotationQuaternion == null) this.cameraRig.rotationQuaternion = BABYLON.Utilities.Euler(this.cameraRig.rotation.x, this.cameraRig.rotation.y, this.cameraRig.rotation.z); this._followCameraOffset = this.mesh.position.subtract(this.cameraRig.position); // Setup character controller camera pivot this.cameraPivot = new BABYLON.Mesh(this.mesh + "CameraPivot", this.scene, this.cameraRig); this.cameraPivot.position = BABYLON.Vector3.Zero(); if (this.cameraPivot.rotationQuaternion == null) this.cameraPivot.rotationQuaternion = BABYLON.Utilities.Euler(this.cameraPivot.rotation.x, this.cameraPivot.rotation.y, this.cameraPivot.rotation.z); // Setup third person free camera and sphere this.freeCamera = new BABYLON.FreeCamera(this.mesh + "FreeCamera", BABYLON.Vector3.Zero(), this.scene); this.freeCamera.position.copyFrom(this.cameraSettings.positionRight); this.freeCamera.rotationQuaternion = BABYLON.Quaternion.Zero(); this.freeCamera.parent = this.cameraPivot; this.cameraSphere = BABYLON.Mesh.CreateSphere(this.mesh + "CameraSphere", 12, 0.5, this.scene); this.cameraSphere.position = BABYLON.Vector3.Zero(); this.cameraSphere.isVisible = false; // DEBUG SETTING this.cameraSphere.visibility = 0.0 // DEBUG SETTING this.cameraSphere.parent = this.freeCamera; if (this._autoActivateCamera === true) this.scene.activeCamera = this.freeCamera; } protected update() :void { // Tick character controller this.updateCameraRotations(); this.updateCameraPositions(); this.updateCharacterMovement(); //console.log("Grounded: " + this._isCharacterGrounded.toString(), " -> Jumping: " + this._isCharacterJumping.toString(), " -> Falling: " + this._isCharacterFalling.toString() + " -> Sliding: " + this._isCharacterSliding.toString()); } protected after():void { // Process Locomotion Input this.frictionLevel = this.baseFriction; if (this.character == null) return; this._isCharacterJumping = this.character.isJumping(); this._isCharacterFalling = this.character.isFalling(); this._isCharacterSliding = this.character.isSliding(); this._isCharacterGrounded = this.character.isGrounded(); this._isCharacterCrouched = false; this._isCharacterJumpFrame = false; if (this.enableInput === true) { this.wheelInput = this.manager.getUserInput(BABYLON.UserInputAxis.Wheel); this.mouseXInput = this.manager.getUserInput(BABYLON.UserInputAxis.MouseX); this.mouseYInput = this.manager.getUserInput(BABYLON.UserInputAxis.MouseY); this.verticalInput = this.manager.getUserInput(BABYLON.UserInputAxis.Vertical); this.horizontalInput = this.manager.getUserInput(BABYLON.UserInputAxis.Horizontal); // Pseudo normalize dead zone input values var deadZone:number = BABYLON.UserInputOptions.GamepadDeadStickValue; if (this.horizontalInput >= -deadZone && this.horizontalInput <= deadZone) this.horizontalInput = 0.0; if (this.verticalInput >= -deadZone && this.verticalInput <= deadZone) this.verticalInput = 0.0; // Update diagonal movement scaling factor this._inputMoveVector.copyFromFloats(this.horizontalInput, 0.0, this.verticalInput); if (this._inputMoveVector.x !== 0.0 && this._inputMoveVector.z !== 0.0) { this._inputMoveVector.scaleInPlace(BABYLON.Constants.DiagonalSpeed); } // Update user input movement speed vector this._inputMoveSpeed = this._inputMoveVector.length(); if (this._inputMoveSpeed > 1.0) { BABYLON.Vector3.NormalizeToRef(this._inputMoveVector, this._inputMoveVector); this._inputMoveSpeed = this._inputMoveVector.length(); } // Update grounded locomotion movement states if (this._inputMoveVector.x || this._inputMoveVector.z) this.frictionLevel = 0.0; if (this._isCharacterGrounded === true) { var sprinting:boolean = (this.manager.getKeyboardInput(this.keyboardSprint) || this.manager.getGamepadButtonInput(this.buttonSprint)) if (this._inputMoveSpeed > 0.5) { this.locomotionState = (sprinting === true) ? BABYLON.ThirdPersonLocomotion.Sprint : BABYLON.ThirdPersonLocomotion.Run; } else if (this._inputMoveSpeed > 0.0) { this.locomotionState = BABYLON.ThirdPersonLocomotion.Walk; } else { this.locomotionState = BABYLON.ThirdPersonLocomotion.Idle; } this.locomotionSpeed = this.getLocomotionSpeed(); //var forward = BABYLON.Utilities.GetForwardVector(this.mesh); //var right = BABYLON.Utilities.GetRightVector(this.mesh); //var move = forward.scale(this._inputMoveVector.z).add(right.scale(this._inputMoveVector.x)); //this.movementVector.x = move.x; //this.movementVector.y = 0.0; //this.movementVector.z = move.z; // Update user input movement properties this.movementVector.x = this._inputMoveVector.x; this.movementVector.y = 0.0; this.movementVector.z = this._inputMoveVector.z; BABYLON.Utilities.TransformDirectionToRef(this.mesh, this.movementVector, this.movementVector); this.movementVector.scaleInPlace(this.locomotionSpeed); // Update user input jumping frame state this._isCharacterJumpFrame = (this.manager.getKeyboardInput(this.keyboardJump) || this.manager.getGamepadButtonInput(this.buttonJump)); if (this._isCharacterJumpFrame === true) { //this.jumpingDirection = this.currentDirection; } } } } protected destroy() :void { // Destroy character controller this.cameraSphere.dispose(); this.cameraSphere = null; this.cameraPivot.dispose(); this.cameraPivot = null; this.cameraRig.dispose(); this.cameraRig = null; this.freeCamera.dispose(); this.freeCamera = null; this.animator = null; this.character = null; } /* Private Character Controller Helper Functions */ private getLocomotionSpeed():number { var speed:number = 0.0; if (this.rootMotion === true) { var rootSpeed:number = 1.0; speed = rootSpeed * this._inputMoveSpeed; } else { switch (this.locomotionState) { case BABYLON.ThirdPersonLocomotion.Idle: speed = 0.0; break; case BABYLON.ThirdPersonLocomotion.Walk: speed = this.walkSpeed; break; case BABYLON.ThirdPersonLocomotion.Run: speed = this.runSpeed; break; case BABYLON.ThirdPersonLocomotion.Sprint: speed = this.sprintSpeed; break; } } return speed; } private updateCameraRotations():void { var deltaTime:number = this.manager.deltaTime; // Update camera left/right this._cameraRotationX += this.cameraSettings.lookXSensitivity * this.mouseXInput; this._cameraRotationX = BABYLON.Scalar.Repeat(this._cameraRotationX, 360); // Update camera up/down this._cameraRotationY += this.cameraSettings.lookYSensitivity * this.mouseYInput; this._cameraRotationY = BABYLON.Scalar.Clamp(this._cameraRotationY, this.cameraSettings.minimumAngle, this.cameraSettings.maximumAngle); // Update camera rotations BABYLON.Utilities.EulerToRef((this._cameraRotationY * BABYLON.Constants.Deg2Rad), (this._cameraRotationX * BABYLON.Constants.Deg2Rad), 0.0, this._cameraRotation); BABYLON.Quaternion.SlerpToRef(this.cameraPivot.rotationQuaternion, this._cameraRotation, this.cameraSettings.rotationSpeed * deltaTime, this.cameraPivot.rotationQuaternion); } private updateCameraPositions():void { var deltaTime:number = this.manager.deltaTime; // Updaye camera rig this.mesh.position.subtractToRef(this._followCameraOffset, this._cameraDestination); this.cameraRig.position.copyFrom(this._cameraDestination); //BABYLON.Vector3.LerpToRef(this.cameraRig.position, this._cameraDestination, (this.cameraSettings.movementLerpSpeed * deltaTime), this.cameraRig.position); // Updaye free camera var hit:boolean = false; // TODO: Dummy no hit if (this.cameraRig == null) { hit = true; } if (hit === true) { // Move Camera In Closer To Player } else { // Position free camera to current sholder if (this._followCameraShoulder === BABYLON.ThirdPersonCameraShoulder.Left) { BABYLON.Vector3.LerpToRef(this.freeCamera.position, this.cameraSettings.positionLeft, (this.cameraSettings.movementLerpSpeed * deltaTime), this.freeCamera.position); } else { BABYLON.Vector3.LerpToRef(this.freeCamera.position, this.cameraSettings.positionRight, (this.cameraSettings.movementLerpSpeed * deltaTime), this.freeCamera.position); } } } private updateCharacterMovement():void { // Update character rotation if (this.movementVector.x !== 0.0 || this.movementVector.z !== 0.0) { //this.mesh.rotationQuaternion.toEulerAnglesToRef(this._meshEulerAngles); //this.cameraPivot.rotationQuaternion.toEulerAnglesToRef(this._pivotEulerAngles); //BABYLON.Utilities.EulerToRef(this._meshEulerAngles.x, this._pivotEulerAngles.y, this._meshEulerAngles.z, this.mesh.rotationQuaternion); //var dir = new BABYLON.Vector3(-this.horizontalInput, 0, -this.verticalInput); //var pos = this.mesh.position.add(dir); //this._meshRotator.lookAtPosition(pos); } // Update character movement if (this.character != null) { //this.currentVelocity = this.character.getVelocity(); //this.movementVector.y = this.currentVelocity.y; this.character.move(this.movementVector, this.frictionLevel, ((this._isCharacterJumpFrame === true) ? this.jumpSpeed : 0.0)); } // Update character animation if (this.animator != null) { this.animator.setFloat("Locomotion", this.locomotionState as number); //this.animator.setFloat("Jumping", this.jumpingState as number); this.animator.setFloat("Forward", this._inputMoveVector.z); this.animator.setFloat("Turn", this._inputMoveVector.x); this.animator.setFloat("Speed", this._inputMoveSpeed); this.animator.setBool("isJumping", this._isCharacterJumping); this.animator.setBool("isFalling", this._isCharacterFalling); this.animator.setBool("isSliding", this._isCharacterSliding); this.animator.setBool("isCrouched", this._isCharacterCrouched); this.animator.setBool("isGrounded", this._isCharacterGrounded); if (this._isCharacterJumpFrame === true) { this.animator.setTrigger("Jump"); } // Note: Manually Ticking Anims this.animator.tickStateMachine(); } } } }  
    Hope that helps you get going 
     
  9. Like
    MackeyK24 got a reaction from Nodragem in [SOLVED] - U3D - BabylonJS Game Editor Toolkit   
    The toolkit pretty much done EXCEPT the 3 functions I need to handle calculating input weights for 2D blend trees... 
    the problem is NO ONE will help me with those calculations... I can’t even PAY anyone to help... I tried... I guess I’m just on my own... that really sucks because it is the last part I need to start teaching all the different game mechanics stuff I have in the toolkit that nobody knows how to use yet.
     
  10. Like
    MackeyK24 got a reaction from trevordev in [SOLVED] - U3D - BabylonJS Game Editor Toolkit   
    Just to Clarify the Problems Folks are having with Camera and Skybox.
    Apparently there is in bug in the newer Unity Editor Versions (Greater then 2018.1.xxx or whatever version @razieh was using) where is DOES NOT set the Main Camera Tag.
    The main camera tag is required to ID which is the scene's Main Camera (including its SKYBOX option).
    So make sure your Main Camera is setup properly:

     
    As for movement... You will either need to attach your own script and move the camera or use the Camera Rig component and choose one of the Camera Input Options and the Scene Manager will handle moving the camera based on your Camera Type.
    Hope that clears up everyone problems using the Newer Unity Editor Versions...
    Just remember to check your Main Camera Setup until Unity Fixes that bug
     
     
     
  11. Like
    MackeyK24 got a reaction from Deltakosh in GLTF Morph Targets Not Working   
    Yo @bghgary ... Thanks a million bro. That was it exactly. I dont know how i missed that. I use buffer list for all values now and switch the handness when dumping into buffer list.. Then i can use that same list for Mix Max Values Function as well as loop thru serializing the values:
     One example ExportAccessor function:
    private AccessorId ExportAccessor(Vector3[] arr, bool switchHandedness=false, string accessorName = null) { var count = arr.Length; if (count == 0) { throw new Exception("Accessors can not have a count of 0."); } var accessor = new Accessor(); accessor.ComponentType = GLTFComponentType.Float; accessor.Count = count; accessor.Type = GLTFAccessorAttributeType.VEC3; accessor.Name = accessorName; List<Vector3> values = new List<Vector3>(); foreach (var vec in arr) { values.Add(switchHandedness ? vec.SwitchHandedness() : vec); } accessor.Min = new List<double> { values.Select(value => value.x).Min(), values.Select(value => value.y).Min(), values.Select(value => value.z).Min() }; accessor.Max = new List<double> { values.Select(value => value.x).Max(), values.Select(value => value.y).Max(), values.Select(value => value.z).Max() }; var byteOffset = _bufferWriter.BaseStream.Position; foreach (var vec in values) { _bufferWriter.Write(vec.x); _bufferWriter.Write(vec.y); _bufferWriter.Write(vec.z); } var byteLength = _bufferWriter.BaseStream.Position - byteOffset; accessor.BufferView = ExportBufferView((int)byteOffset, (int)byteLength); var id = new AccessorId { Id = _root.Accessors.Count, Root = _root }; _root.Accessors.Add(accessor); return id; } Works like a charm... 0 ERRORS now... Thanks again
     
  12. Like
    MackeyK24 got a reaction from bghgary in GLTF Morph Targets Not Working   
    Yo @bghgary ... Thanks a million bro. That was it exactly. I dont know how i missed that. I use buffer list for all values now and switch the handness when dumping into buffer list.. Then i can use that same list for Mix Max Values Function as well as loop thru serializing the values:
     One example ExportAccessor function:
    private AccessorId ExportAccessor(Vector3[] arr, bool switchHandedness=false, string accessorName = null) { var count = arr.Length; if (count == 0) { throw new Exception("Accessors can not have a count of 0."); } var accessor = new Accessor(); accessor.ComponentType = GLTFComponentType.Float; accessor.Count = count; accessor.Type = GLTFAccessorAttributeType.VEC3; accessor.Name = accessorName; List<Vector3> values = new List<Vector3>(); foreach (var vec in arr) { values.Add(switchHandedness ? vec.SwitchHandedness() : vec); } accessor.Min = new List<double> { values.Select(value => value.x).Min(), values.Select(value => value.y).Min(), values.Select(value => value.z).Min() }; accessor.Max = new List<double> { values.Select(value => value.x).Max(), values.Select(value => value.y).Max(), values.Select(value => value.z).Max() }; var byteOffset = _bufferWriter.BaseStream.Position; foreach (var vec in values) { _bufferWriter.Write(vec.x); _bufferWriter.Write(vec.y); _bufferWriter.Write(vec.z); } var byteLength = _bufferWriter.BaseStream.Position - byteOffset; accessor.BufferView = ExportBufferView((int)byteOffset, (int)byteLength); var id = new AccessorId { Id = _root.Accessors.Count, Root = _root }; _root.Accessors.Add(accessor); return id; } Works like a charm... 0 ERRORS now... Thanks again
     
  13. Thanks
    MackeyK24 got a reaction from razieh in [SOLVED] - U3D - BabylonJS Game Editor Toolkit   
    Just to Clarify the Problems Folks are having with Camera and Skybox.
    Apparently there is in bug in the newer Unity Editor Versions (Greater then 2018.1.xxx or whatever version @razieh was using) where is DOES NOT set the Main Camera Tag.
    The main camera tag is required to ID which is the scene's Main Camera (including its SKYBOX option).
    So make sure your Main Camera is setup properly:

     
    As for movement... You will either need to attach your own script and move the camera or use the Camera Rig component and choose one of the Camera Input Options and the Scene Manager will handle moving the camera based on your Camera Type.
    Hope that clears up everyone problems using the Newer Unity Editor Versions...
    Just remember to check your Main Camera Setup until Unity Fixes that bug
     
     
     
  14. Thanks
    MackeyK24 got a reaction from razieh in [SOLVED] - U3D - BabylonJS Game Editor Toolkit   
    I found the issue... Is bug with the LATER Unity Editor Versions... Its seems when creating a new scene, Unity IS NOT setting the Main Camera Tag to "MainCamera".
    The Main Camera MUST BE TAGGED. Unity should do this by default for the Main Camera in the scene... it used to for years.. Is a bug... Until they fix... Just Select your Main Camera and Change The Tag o "MainCamera"
  15. Like
    MackeyK24 got a reaction from bghgary in GLTF Morph Targets Not Working   
    Yo @bghgary did you notice the multiple skeleton animations in that test Remy model.
    FYI... I made that export using that Animation baking code I sent you before where I thru all the bones and SAMPLE the animation clip then encode the TRS for each bone at the given frame time
    All other UnityGLTF seem to be missing that part that actually encode skeleton animations 
    but my Canvas Tools works great... I am working on the actual blend shape animation key frames next 😀
  16. Thanks
    MackeyK24 got a reaction from razieh in [SOLVED] - U3D - BabylonJS Game Editor Toolkit   
    I’ll make another video and try explain defaults better... technically you don’t need a default scene controller... if if does not find one... the toolkit will use the default options of a scene controller... buts it’s better to put one on the scene so you can easily see and get to those options...
    i do not automatically attach input control on the main camera... mainly because you need to select what type of camera and what type of input you want to use... either moving camera with the scene manager api to update camera input or use the native Babylon attachCamera functionality 
    i will try explain this  in another video... I got company visiting me in Maui. So when I get a chance ... I make a video for you
  17. Like
    MackeyK24 got a reaction from HeadClot in [SOLVED] - U3D - BabylonJS Game Editor Toolkit   
    Visual Studio Code is now NATIVE supported. The new toolkit removes the OLD VSCode.cs Plugin.
    So Again... Try new toolkit with fresh project.... Then go change youe Code Editor To VSCode... If it is not listed... Use Browse Button to find on your hard disk... Once Unity Finds it the First Time... It Should Always Find it
     
  18. Thanks
    MackeyK24 got a reaction from razieh in [SOLVED] - U3D - BabylonJS Game Editor Toolkit   
    Yo @razieh ... After you get all updated to latest toolkit and made fresh project... If you still having problems... Make a Video and show me. Maybe i can help figure out what the deal is
     
  19. Thanks
    MackeyK24 got a reaction from razieh in [SOLVED] - U3D - BabylonJS Game Editor Toolkit   
    I just made a PR # 330 (https://github.com/BabylonJS/Exporters/pull/330)
    That update to Toolkit 3.3 RC4 using Latest Unity 2018
    After @Deltakosh OK the PR... Try again with fresh toolkit and project
     
  20. Thanks
    MackeyK24 got a reaction from razieh in [SOLVED] - U3D - BabylonJS Game Editor Toolkit   
    I will try to publish Babylon Toolkit 3.3 Beta ... that will for sure sync up the Babylon.d.ts with the proper toolkit version for use with typescript 3.0.2...
    i will try tonight
  21. Like
    MackeyK24 got a reaction from MarianG in Test GLTF Animations   
    GLB ... yes
    From what I can tell I can only see decoder for Unity ... No encoders... so Draco compression will not be supported til they make an Encoder that cab used from Unity
  22. Like
    MackeyK24 got a reaction from bghgary in Test GLTF Animations   
    Holy Shit... After taking apart, STRIPPING and RE-WRITING the SketchFab 1.0.0 UnityGLTF the export process workflow for things like:
    1... Material fallbacks - Supports PBR Specular... and coming soon... CommonPhong, CommonBlinn and CommonLambert materials
    2.. PBR Gloss Mapping - Supports the PROPER glossing levels across GLTF PNG Rendering Implementations
    3... Multiple Transform Animations - Support both UnityEngine.Animation and UnityAnimator Control Support)
    4... Multiple Skeletal Animations - Supports both Unity Mechanim Generic and Humanoid animation rigging (My OWN Design... Nothing else to go off of)
    5... Full Unity Meta Data - Export Unity component data as GLTF Extra Metadata  (CVToos-unity-metadata)
    6... GLTF or GLB - Supports full internal binary asset container packages for all images, skyboxes, dds, sounds, json, txt, etc...
    I had to basically create my own animation baking system (using Sketchfab style of Unity GLTF Export but with all my BabylonToolkit style export code)
    But finally working beautifully...
    My new Canvas Tools are gonna be 10 Times better than my first generation toolkit is...
    Will post BLOG video of my progress.. Just in case ANYONE is actually interested in my new CanvasTools
    Example Shot os VSCode preview the export scene content SampleScene.gltf with a few test objects and two Skeleton animations ... Working beautiful... and that GLTF scene file can be used ANYWHERE that supports GLTF and GLB 2.0 Scene Files (and for extended usage....CVTOOLS_unity_metadata)

     
    Freakin Sweet... That is the CORE framework to my new CanvasTools... I had to figure out GLTF Encoding then re-write all the code myself again
     
  23. Thanks
    MackeyK24 got a reaction from MarianG in Test GLTF Animations   
    My Goal is to create all the Functionality of the Babylon Toolkit but for native GLTF Encoding... NOT .babylon File Format.
    Of course Babylon.Js has the best GLTF render of the WebGL world and my exported scene look beautiful in Babylon.JS
    But now you can use that exported content with any GLTF 2.0 implementations ... Including Native game engines Like Unreal and Godot (Via its GLTF Importers)
    My GLTF Vision... Called Canvas Tools (Named for its general purpose WebGL HTML5 Canvas game dev tools... Not anything to do with PlayCanvas specifically)
     
  24. Thanks
    MackeyK24 got a reaction from Pryme8 in Demo with Ammo.js Physics Engine   
    I think the 170 is compressed
  25. Thanks
    MackeyK24 got a reaction from Rodrix3 in Getting Started With The Babylon Toolkit   
    The Babylon Toolkit Getting Started Video