@babylonjs/serializers
Advanced tools
Comparing version 4.1.0-beta.25 to 4.1.0-beta.26
@@ -63,4 +63,5 @@ import { Vector3, Color3, Quaternion } from "@babylonjs/core/Maths/math"; | ||
var lightPosition = babylonLight.position.clone(); | ||
var convertToRightHandedSystem = _this._exporter._convertToRightHandedSystemMap[babylonNode.uniqueId]; | ||
if (!lightPosition.equals(Vector3.Zero())) { | ||
if (_this._exporter._convertToRightHandedSystem) { | ||
if (convertToRightHandedSystem) { | ||
_GLTFUtilities._GetRightHandedPositionVector3FromRef(lightPosition); | ||
@@ -76,3 +77,3 @@ } | ||
var lightRotationQuaternion = Quaternion.RotationYawPitchRoll(yaw, pitch, 0); | ||
if (_this._exporter._convertToRightHandedSystem) { | ||
if (convertToRightHandedSystem) { | ||
_GLTFUtilities._GetRightHandedQuaternionFromRef(lightRotationQuaternion); | ||
@@ -79,0 +80,0 @@ } |
@@ -81,2 +81,3 @@ import { AnimationSamplerInterpolation, AnimationChannelTargetPath, AccessorType, IAnimation, INode, IBufferView, IAccessor } from "babylonjs-gltf2interface"; | ||
* @param convertToRightHandedSystem | ||
* @param animationSampleRate | ||
*/ | ||
@@ -96,7 +97,10 @@ static _CreateNodeAnimationFromNodeAnimations(babylonNode: Node, runtimeGLTFAnimation: IAnimation, idleGLTFAnimations: IAnimation[], nodeMap: { | ||
* @param accessors | ||
* @param convertToRightHandedSystem | ||
* @param convertToRightHandedSystemMap | ||
* @param animationSampleRate | ||
*/ | ||
static _CreateNodeAnimationFromAnimationGroups(babylonScene: Scene, glTFAnimations: IAnimation[], nodeMap: { | ||
[key: number]: number; | ||
}, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void; | ||
}, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystemMap: { | ||
[nodeId: number]: boolean; | ||
}, animationSampleRate: number): void; | ||
private static AddAnimation; | ||
@@ -103,0 +107,0 @@ /** |
@@ -124,2 +124,3 @@ import { Vector3, Quaternion } from "@babylonjs/core/Maths/math"; | ||
* @param convertToRightHandedSystem | ||
* @param animationSampleRate | ||
*/ | ||
@@ -158,5 +159,6 @@ _GLTFAnimation._CreateNodeAnimationFromNodeAnimations = function (babylonNode, runtimeGLTFAnimation, idleGLTFAnimations, nodeMap, nodes, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, animationSampleRate) { | ||
* @param accessors | ||
* @param convertToRightHandedSystem | ||
* @param convertToRightHandedSystemMap | ||
* @param animationSampleRate | ||
*/ | ||
_GLTFAnimation._CreateNodeAnimationFromAnimationGroups = function (babylonScene, glTFAnimations, nodeMap, nodes, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, animationSampleRate) { | ||
_GLTFAnimation._CreateNodeAnimationFromAnimationGroups = function (babylonScene, glTFAnimations, nodeMap, nodes, binaryWriter, bufferViews, accessors, convertToRightHandedSystemMap, animationSampleRate) { | ||
var glTFAnimation; | ||
@@ -180,2 +182,3 @@ if (babylonScene.animationGroups) { | ||
var babylonTransformNode = target instanceof TransformNode ? target : target[0]; | ||
var convertToRightHandedSystem = convertToRightHandedSystemMap[babylonTransformNode.uniqueId]; | ||
_GLTFAnimation.AddAnimation("" + animation.name, glTFAnimation, babylonTransformNode, animation, animationInfo.dataAccessorType, animationInfo.animationChannelTargetPath, nodeMap, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, animationInfo.useQuaternion, animationSampleRate); | ||
@@ -182,0 +185,0 @@ } |
@@ -93,6 +93,13 @@ import { IBufferView, IAccessor, INode, IMaterial, ITexture, IImage, ISampler, ImageMimeType, IMeshPrimitive, IGLTF, ITextureInfo } from "babylonjs-gltf2interface"; | ||
/** | ||
* Specifies if the Babylon scene should be converted to right-handed on export | ||
* Specifies if the source Babylon scene was left handed, and needed conversion. | ||
*/ | ||
_convertToRightHandedSystem: boolean; | ||
/** | ||
* Specifies if a Babylon node should be converted to right-handed on export | ||
*/ | ||
_convertToRightHandedSystemMap: { | ||
[nodeId: number]: boolean; | ||
}; | ||
_includeCoordinateSystemConversionNodes: boolean; | ||
/** | ||
* Baked animation sample rate | ||
@@ -155,2 +162,3 @@ */ | ||
* @param binaryWriter The binary data for the glTF file | ||
* @param convertToRightHandedSystem Converts the values to right-handed | ||
*/ | ||
@@ -168,2 +176,3 @@ private reorderVertexAttributeDataBasedOnPrimitiveMode; | ||
* @param binaryWriter The binary data for the glTF file | ||
* @param convertToRightHandedSystem Converts the values to right-handed | ||
*/ | ||
@@ -181,2 +190,3 @@ private reorderTriangleFillMode; | ||
* @param binaryWriter The binary data for the glTF file | ||
* @param convertToRightHandedSystem Converts the values to right-handed | ||
*/ | ||
@@ -194,2 +204,3 @@ private reorderTriangleStripDrawMode; | ||
* @param binaryWriter The binary data for the glTF file | ||
* @param convertToRightHandedSystem Converts the values to right-handed | ||
*/ | ||
@@ -204,2 +215,3 @@ private reorderTriangleFanMode; | ||
* @param binaryWriter The writer containing the binary data | ||
* @param convertToRightHandedSystem Converts the values to right-handed | ||
*/ | ||
@@ -214,4 +226,5 @@ private writeVertexAttributeData; | ||
* @param indices Used to specify the order of the vertex data | ||
* @param convertToRightHandedSystem Converts the values to right-handed | ||
*/ | ||
writeAttributeData(vertexBufferKind: string, meshAttributeArray: FloatArray, byteStride: number, binaryWriter: _BinaryWriter): void; | ||
writeAttributeData(vertexBufferKind: string, meshAttributeArray: FloatArray, byteStride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean): void; | ||
/** | ||
@@ -251,2 +264,3 @@ * Generates glTF json data | ||
* @param babylonTransformNode Babylon mesh used as the source for the transformation data | ||
* @param convertToRightHandedSystem Converts the values to right-handed | ||
*/ | ||
@@ -260,2 +274,3 @@ private setNodeTransformation; | ||
* @param binaryWriter The buffer to write the bufferview data to | ||
* @param convertToRightHandedSystem Converts the values to right-handed | ||
*/ | ||
@@ -286,5 +301,12 @@ private createBufferViewKind; | ||
* @param binaryWriter Buffer to write the attribute data to | ||
* @param convertToRightHandedSystem Converts the values to right-handed | ||
*/ | ||
private setPrimitiveAttributesAsync; | ||
/** | ||
* Check if the node is used to convert its descendants from a right handed coordinate system to the Babylon scene's coordinate system. | ||
* @param node The node to check | ||
* @returns True if the node is used to convert its descendants from right-handed to left-handed. False otherwise | ||
*/ | ||
private isBabylonCoordinateSystemConvertingNode; | ||
/** | ||
* Creates a glTF scene based on the array of meshes | ||
@@ -308,2 +330,3 @@ * Returns the the total byte offset | ||
* @param binaryWriter Buffer for storing geometry data | ||
* @param convertToRightHandedSystem Converts the values to right-handed | ||
* @returns glTF node | ||
@@ -310,0 +333,0 @@ */ |
@@ -28,2 +28,6 @@ import { Node } from "@babylonjs/core/node"; | ||
exportWithoutWaitingForScene?: boolean; | ||
/** | ||
* Indicates if coordinate system swapping root nodes should be included in export | ||
*/ | ||
includeCoordinateSystemConversionNodes?: boolean; | ||
} | ||
@@ -30,0 +34,0 @@ /** |
@@ -7,3 +7,3 @@ { | ||
"description": "The Babylon.js serializers library is an extension you can use to serialize Babylon scenes.", | ||
"version": "4.1.0-beta.25", | ||
"version": "4.1.0-beta.26", | ||
"repository": { | ||
@@ -99,4 +99,4 @@ "type": "git", | ||
"dependencies": { | ||
"@babylonjs/core": "4.1.0-beta.25", | ||
"babylonjs-gltf2interface": "4.1.0-beta.25", | ||
"@babylonjs/core": "4.1.0-beta.26", | ||
"babylonjs-gltf2interface": "4.1.0-beta.26", | ||
"tslib": "^1.10.0" | ||
@@ -103,0 +103,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
661169
5495
+ Added@babylonjs/core@4.1.0-beta.26(transitive)
+ Addedbabylonjs-gltf2interface@4.1.0-beta.26(transitive)
- Removed@babylonjs/core@4.1.0-beta.25(transitive)
- Removedbabylonjs-gltf2interface@4.1.0-beta.25(transitive)