Skip to content

Commit

Permalink
Merge Dev1.4 to main (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
cptbtptpbcptdtptp authored Jan 21, 2025
1 parent 340197c commit 20a0d77
Show file tree
Hide file tree
Showing 62 changed files with 2,120 additions and 2,289 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,13 @@ jobs:
- name: Install dependencies
run: pnpm install

- run: npm run ci
- run: pnpm install codecov -w
- name: Build
run: pnpm b:all
- name: test-cov
run: npm run test-cov
- name: Upload coverage to Codecov
run: ./node_modules/.bin/codecov
- run: curl -s https://codecov.io/bash
uses: codecov/codecov-action@v4
with:
token: ${{secrets.CODECOV_TOKEN}}
fail_ci_if_error: true
flags: unittests
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@galacean/engine-toolkit-root",
"version": "1.3.10",
"version": "1.4.0",
"packageManager": "[email protected]",
"private": true,
"workspaces": [
Expand Down Expand Up @@ -74,7 +74,7 @@
},
"pnpm": {
"overrides": {
"@galacean/engine": "^1.3.0-beta.6"
"@galacean/engine": "^1.4.0"
}
}
}
4 changes: 2 additions & 2 deletions packages/auxiliary-lines/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@galacean/engine-toolkit-auxiliary-lines",
"version": "1.3.10",
"version": "1.4.0",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
Expand All @@ -24,7 +24,7 @@
"types/**/*"
],
"peerDependencies": {
"@galacean/engine": "^1.3.0-beta.6"
"@galacean/engine": "^1.4.0"
},
"dependencies": {
"@galacean/engine-toolkit-custom-material": "workspace:*"
Expand Down
59 changes: 48 additions & 11 deletions packages/auxiliary-lines/src/WireframeManager.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
import {
BoolUpdateFlag,
BoxColliderShape,
BoxShape,
Camera,
CapsuleColliderShape,
CircleShape,
Collider,
ColliderShapeUpAxis,
Color,
dependentComponents,
ConeShape,
DependentMode,
DirectLight,
Entity,
GLCapabilityType,
HemisphereShape,
MathUtil,
Matrix,
MeshRenderer,
MeshTopology,
ModelMesh,
ParticleRenderer,
PointLight,
Quaternion,
Renderer,
Script,
SphereColliderShape,
SphereShape,
SpotLight,
Transform,
Vector2,
Vector3,
DependentMode,
ParticleRenderer,
BoxShape,
CircleShape,
ConeShape,
HemisphereShape,
SphereShape
dependentComponents
} from "@galacean/engine";
import { PlainColorMaterial } from "@galacean/engine-toolkit-custom-material";
import { WireframePrimitive } from "./WireframePrimitive";
Expand Down Expand Up @@ -350,7 +352,12 @@ export class WireframeManager extends Script {
indices,
this._indicesCount
);
Quaternion.rotationYawPitchRoll(rotation.y, rotation.x, rotation.z, tempRotation);
Quaternion.rotationYawPitchRoll(
MathUtil.degreeToRadian(rotation.y),
MathUtil.degreeToRadian(rotation.x),
MathUtil.degreeToRadian(rotation.z),
tempRotation
);
this._localRotation(positionsOffset, tempRotation);
Vector3.multiply(position, worldScale, tempVector);
this._localTranslate(positionsOffset, tempVector);
Expand Down Expand Up @@ -382,7 +389,12 @@ export class WireframeManager extends Script {
indices,
this._indicesCount
);
Quaternion.rotationYawPitchRoll(rotation.y, rotation.x, rotation.z, tempRotation);
Quaternion.rotationYawPitchRoll(
MathUtil.degreeToRadian(rotation.y),
MathUtil.degreeToRadian(rotation.x),
MathUtil.degreeToRadian(rotation.z),
tempRotation
);
this._localRotation(positionsOffset, tempRotation);
Vector3.multiply(position, worldScale, tempVector);
this._localTranslate(positionsOffset, tempVector);
Expand Down Expand Up @@ -431,7 +443,12 @@ export class WireframeManager extends Script {
case ColliderShapeUpAxis.Z:
tempAxis.set(halfSqrt, 0, 0, halfSqrt);
}
Quaternion.rotationYawPitchRoll(rotation.y, rotation.x, rotation.z, tempRotation);
Quaternion.rotationYawPitchRoll(
MathUtil.degreeToRadian(rotation.y),
MathUtil.degreeToRadian(rotation.x),
MathUtil.degreeToRadian(rotation.z),
tempRotation
);
Quaternion.multiply(tempRotation, tempAxis, tempRotation);
this._localRotation(positionsOffset, tempRotation);
Vector3.multiply(position, worldScale, tempVector);
Expand Down Expand Up @@ -569,6 +586,26 @@ export class WireframeManager extends Script {
this._wireframeElements.push(new WireframeElement(transform, positionsOffset, false));
}

addRectShapeWireframe(size: Vector2, pivot: Vector2, transform: Transform): void {
const positionsOffset = this._localPositions.length;
const cuboidIndicesCount = WireframePrimitive.rectIndexCount;
this._growthIndexMemory(cuboidIndicesCount);
this._growthPosition(WireframePrimitive.rectPositionCount);
const { _indices: indices, _localPositions: localPositions } = this;
WireframePrimitive.createRectWireframe(
size.x,
size.y,
pivot.x,
pivot.y,
localPositions,
positionsOffset,
indices,
this._indicesCount
);
this._indicesCount += WireframePrimitive.rectIndexCount;
this._wireframeElements.push(new WireframeElement(transform, positionsOffset, false));
}

override onAwake(): void {
const engine = this.engine;
const mesh = new ModelMesh(engine);
Expand Down
53 changes: 53 additions & 0 deletions packages/auxiliary-lines/src/WireframePrimitive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ export class WireframePrimitive {
/** global settings for vertex count */
static circleVertexCount = 40;

/**
* Get rect wire frame index count.
*/
static get rectIndexCount(): number {
return 8;
}

/**
* Get rect wire frame position count.
*/
static get rectPositionCount(): number {
return 4;
}

/**
* Get cuboid wire frame index count.
*/
Expand Down Expand Up @@ -741,4 +755,43 @@ export class WireframePrimitive {
indicesOffset + WireframePrimitive.circleVertexCount
);
}

/**
* Store rect wireframe mesh data.
* @param width - The width of rect
* @param height - The height of rect
* @param pivotX - The pivot x of rect
* @param pivotY - The pivot y of rect
* @param positions - position array
* @param positionOffset - The min of index list
* @param indices - index array
* @param indicesOffset - index array offset
*/
static createRectWireframe(
width: number,
height: number,
pivotX: number,
pivotY: number,
positions: Vector3[],
positionOffset: number,
indices: Uint16Array | Uint32Array,
indicesOffset: number
): void {
// 0 -- 3
// | |
// 1 -- 2
positions[positionOffset].set(-width * pivotX, height * (1 - pivotY), 0);
positions[positionOffset + 1].set(-width * pivotX, -height * pivotY, 0);
positions[positionOffset + 2].set(width * (1 - pivotX), -height * pivotY, 0);
positions[positionOffset + 3].set(width * (1 - pivotX), height * (1 - pivotY), 0);

indices[indicesOffset++] = positionOffset;
indices[indicesOffset++] = positionOffset + 1;
indices[indicesOffset++] = positionOffset + 1;
indices[indicesOffset++] = positionOffset + 2;
indices[indicesOffset++] = positionOffset + 2;
indices[indicesOffset++] = positionOffset + 3;
indices[indicesOffset++] = positionOffset + 3;
indices[indicesOffset++] = positionOffset;
}
}
4 changes: 2 additions & 2 deletions packages/controls/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@galacean/engine-toolkit-controls",
"version": "1.3.10",
"version": "1.4.0",
"license": "MIT",
"publishConfig": {
"access": "public",
Expand All @@ -24,6 +24,6 @@
"types/**/*"
],
"peerDependencies": {
"@galacean/engine": "^1.3.0-beta.6"
"@galacean/engine": "^1.4.0"
}
}
4 changes: 2 additions & 2 deletions packages/custom-gltf-parser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@galacean/engine-toolkit-custom-gltf-parser",
"version": "1.3.10",
"version": "1.4.0",
"license": "MIT",
"scripts": {
"b:types": "tsc"
Expand All @@ -23,6 +23,6 @@
"types/**/*"
],
"peerDependencies": {
"@galacean/engine": "^1.3.0-beta.6"
"@galacean/engine": "^1.4.0"
}
}
4 changes: 2 additions & 2 deletions packages/custom-material/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@galacean/engine-toolkit-custom-material",
"version": "1.3.10",
"version": "1.4.0",
"license": "MIT",
"scripts": {
"b:types": "tsc",
Expand All @@ -24,6 +24,6 @@
"types/**/*"
],
"peerDependencies": {
"@galacean/engine": "^1.3.0-beta.6"
"@galacean/engine": "^1.4.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#define FUNCTION_SPECULAR_IBL evaluateSpecularIBLIridescence
#include "BRDF.glsl"
#include "./IridescenceFunction.glsl"
#include "LightProbe.glsl"
#include "LightIndirectFunctions.glsl"

void evaluateSpecularIBLIridescence(Varyings varyings, SurfaceData surfaceData, BRDFData brdfData, float radianceAttenuation, inout vec3 specularColor){

Expand Down
4 changes: 2 additions & 2 deletions packages/draco/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@galacean/engine-toolkit-draco",
"version": "1.3.10",
"version": "1.4.0",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
Expand All @@ -20,6 +20,6 @@
"types/**/*"
],
"dependencies": {
"@galacean/engine": "^1.3.0-beta.6"
"@galacean/engine": "^1.4.0"
}
}
4 changes: 2 additions & 2 deletions packages/dynamic-bone/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@galacean/engine-toolkit-dynamic-bone",
"version": "1.3.10",
"version": "1.4.0",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
Expand All @@ -24,6 +24,6 @@
"types/**/*"
],
"peerDependencies": {
"@galacean/engine": "^1.3.0-beta.6"
"@galacean/engine": "^1.4.0"
}
}
4 changes: 2 additions & 2 deletions packages/framebuffer-picker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@galacean/engine-toolkit-framebuffer-picker",
"version": "1.3.10",
"version": "1.4.0",
"license": "MIT",
"module": "dist/es/index.js",
"main": "dist/commonjs/browser.js",
Expand All @@ -23,6 +23,6 @@
"types/**/*"
],
"peerDependencies": {
"@galacean/engine": "^1.3.0-beta.6"
"@galacean/engine": "^1.4.0"
}
}
5 changes: 2 additions & 3 deletions packages/galacean-engine-toolkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@galacean/engine-toolkit",
"version": "1.3.10",
"version": "1.4.0",
"license": "MIT",
"scripts": {
"b:types": "tsc"
Expand Down Expand Up @@ -39,7 +39,6 @@
"@galacean/engine-toolkit-custom-material": "workspace:*",
"@galacean/engine-toolkit-navigation-gizmo": "workspace:*",
"@galacean/engine-toolkit-geometry-sketch": "workspace:*",
"@galacean/engine-toolkit-stats": "workspace:*",
"@galacean/engine-toolkit-shader-lab": "workspace:*"
"@galacean/engine-toolkit-stats": "workspace:*"
}
}
1 change: 0 additions & 1 deletion packages/galacean-engine-toolkit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export * from "@galacean/engine-toolkit-custom-material";
export * from "@galacean/engine-toolkit-navigation-gizmo";
export * from "@galacean/engine-toolkit-geometry-sketch";
export * from "@galacean/engine-toolkit-stats";
export * from "@galacean/engine-toolkit-shader-lab";

//@ts-ignore
export const version = `__buildVersion`;
Expand Down
4 changes: 2 additions & 2 deletions packages/geometry-sketch/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@galacean/engine-toolkit-geometry-sketch",
"version": "1.3.10",
"version": "1.4.0",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
Expand All @@ -24,6 +24,6 @@
"types/**/*"
],
"peerDependencies": {
"@galacean/engine": "^1.3.0-beta.6"
"@galacean/engine": "^1.4.0"
}
}
5 changes: 3 additions & 2 deletions packages/gizmo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@galacean/engine-toolkit-gizmo",
"version": "1.3.10",
"version": "1.4.0",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
Expand All @@ -24,7 +24,8 @@
"types/**/*"
],
"peerDependencies": {
"@galacean/engine": "^1.3.0-beta.6"
"@galacean/engine": "^1.4.0",
"@galacean/engine-ui": "1.4.0"
},
"dependencies": {
"@galacean/engine-toolkit-framebuffer-picker": "workspace:*",
Expand Down
Loading

0 comments on commit 20a0d77

Please sign in to comment.