Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add rotateAxisAngle for Quaternion #480

Merged
merged 6 commits into from
Sep 7, 2021
Merged

feat: add rotateAxisAngle for Quaternion #480

merged 6 commits into from
Sep 7, 2021

Conversation

JujieX
Copy link
Member

@JujieX JujieX commented Sep 6, 2021

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

feat: add rotateAxisAngle for Quaternion

What is the current behavior? (You can also link to an open issue here)

no such calculation

What is the new behavior (if this is a feature change)?

rotateAxisAngle

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

Other information:

@JujieX JujieX requested review from GuoLei1990 and a team September 6, 2021 08:59
@JujieX JujieX marked this pull request as ready for review September 6, 2021 09:00
@codecov-commenter
Copy link

codecov-commenter commented Sep 6, 2021

Codecov Report

Merging #480 (bd4fcc6) into main (5a30d50) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #480      +/-   ##
==========================================
+ Coverage   47.99%   48.04%   +0.04%     
==========================================
  Files         349      349              
  Lines       18968    18973       +5     
  Branches     2548     2546       -2     
==========================================
+ Hits         9104     9115      +11     
+ Misses       9864     9858       -6     
Impacted Files Coverage Δ
packages/math/src/Quaternion.ts 93.35% <100.00%> (+1.94%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a30d50...bd4fcc6. Read the comment docs.

* @returns This quaternion
*/
rotateAxisAngle(axis: Vector3, rad: number): Quaternion {
Quaternion._tempQuat1.rotateAxisAngle(axis, rad);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quaternion.rotateAxisAngle is dead loop.

@@ -9,6 +9,7 @@ import { Vector3 } from "./Vector3";
export class Quaternion implements IClone {
/** @internal */
static readonly _tempVector3 = new Vector3();
static readonly _tempQuat1 = new Quaternion();
Copy link
Collaborator

@gz65555 gz65555 Sep 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a /** @internal */ comment.

@@ -697,4 +699,16 @@ export class Quaternion implements IClone {
Quaternion.lerp(this, quat, t, this);
return this;
}

/**
* Create this quaternion rotate around an arbitrary axis.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use create in the comment of Instance method.

Copy link
Collaborator

@gz65555 gz65555 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Member

@GuoLei1990 GuoLei1990 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@GuoLei1990 GuoLei1990 merged commit 2878bdf into galacean:main Sep 7, 2021
GuoLei1990 added a commit that referenced this pull request Nov 11, 2021
* feat: solve math design circular dependency (#485)

* feat: solve math design cirular dependency

* Revert "feat: solve math design circular dependency (#485)" (#487)

This reverts commit df25f03.

* feat: add rotateAxisAngle for Quaternion (#480)

* feat: add rotateAxisAngle for Quaternion

* refactor: delete useless scene raycast (#493)

* fix: group other uniform block (#504)

* fix(primitivemesh): fix cylinder error (#526)

* Perf: release gpu command (#503)

* perf: release viewport gpu command

* perf: release clearColor gpu command

* fix: reset clipTime (#530)

* fix: reset clipTime

* fix: use string replace asset type to extend easily (#520)

* Fix/animator (#531)

* fix: animator bug

* Update README.md

* Fix: cubic interpolation and crossfade bug: From fixed pose to dest pose, throw error. (#534)

* fix: Animator bug

* v0.5.3

* v0.5.4

* v0.5.5

* v0.5.6

* fix(2d): opt shader precision (#542)

* fix: delete default gl state (#550)

Co-authored-by: shensi.zxd <[email protected]>

* fix(gl): fix gl error (#555)

* v0.5.7

* Fix Call EndRender Error (#563)

* fix: onEndRender trigger error

* feat: support skybox with hdr(rgbe) format (#567)

* feat: add rgbm decode mode

* fix: color space correction (#566)

* fix: color space correction

* fix: bump version (#568)

* feat: change clipTime to normalized as same as  transitionTime for mo… (#560)

* feat: change clipTime to normalized as same as  transitionTime for more understandable

* Update README.md

* Update README.md

* Update README.md

* feat: add method: addEvent overload (#559)

* feat: support ambient-light replacement (#569)

* feat: support ambient-light replacement

Co-authored-by: shensi.zxd <[email protected]>
Co-authored-by: GuoLei <[email protected]>

* Feat/ambient light adapter editor (#570)

* feat: adapter oasis editor with ambient light

* feat: add getCurrentAnimatorState API and fix crossfade time (#565)

* fix: use alipay cdn for physx wasm (#571)

* add wasm file (#572)

* fix: use alipay cdn for physx wasm

* fix: include wasm files

* Fix : the compatibility problem of IOS lower version (#573)

* fix: the compatibility problem of IOS lower version

* Merge dev/0.6 branch (#574)

* feat: solve math design circular dependency (#488)

* feat: solve math design cirular dependency

* PhysX based raycast and collider (#505)

* feat: add physx version raycast and trigger
* feat: add  trigger event in script

* feat: Add InputManager (#497)

* feat:  add InputManager

* Fix InputManager's Bug which will be triggered when there is no physics engine. (#524)

* fix:InputManager modify timing

* Lite Physics Package (#522)

* feat: add physics lite package

* Refactor: split pbr shader  (#514)

* refactor: pbr shader clean up

* feat: add createCapsule in PrimitiveMesh (#515)

* feat: add createCapsule in PrimitiveMesh

* Feat: support read/write mipmap data from textures and render target (#382)

* feat: support render to mip level

* feat: support reading from texture with mip level

* Feat: hdr runtime (#523)

* feat: support IBL  HDR Specular

* perf: plane horizontal default (#535)

* perf(plane): plane horizontal default

* fix(plane): fix cull face (#537)

* fix(plane): fix uv error (#538)

* feat: add more uv channel and color (#548)

* Feat: Sprite add clone function. (#532)

* feat: sprite add clone function

* Add color space (#543)

* feat: add engine settings

* fix: opt code (#519)

* feat: modify physics-related class for editor (#547)

* feat: modify physics-related class for editor

* Merge main to dev/0.6 (#553)

* refactor: merge main to dev/0.6

* fix: bump verison (#557)

Co-authored-by: shensi.zxd <[email protected]>

* fix: shader error (#556)

Co-authored-by: shensi.zxd <[email protected]>

* feat/add AnimatorState script for handle animatorState's lifecycle (#552)

* feat: add `StateMachineScript`

* feat: support skybox with hdr(rgbe) format (#567)

* feat: add rgbm decode mode

* fix: color space correction (#566)

* fix: color space correction

* fix: bump version (#568)

* feat: change clipTime to normalized as same as  transitionTime for mo… (#560)

* feat: change clipTime to normalized as same as  transitionTime for more understandable

* feat: add method: addEvent overload (#559)

* feat: support ambient-light replacement (#569)

* feat: support ambient-light replacement

Co-authored-by: shensi.zxd <[email protected]>
Co-authored-by: GuoLei <[email protected]>

* Feat/ambient light adapter editor (#570)

* feat: adapter oasis editor with ambient light

* feat: add getCurrentAnimatorState API and fix crossfade time (#565)

* fix: use alipay cdn for physx wasm (#571)

* add wasm file (#572)

* fix: use alipay cdn for physx wasm

* fix: include wasm files

* Fix : the compatibility problem of IOS lower version (#573)

* fix: the compatibility problem of IOS lower version

Co-authored-by: yangfengzzz <[email protected]>
Co-authored-by: AZhan <[email protected]>
Co-authored-by: zhuxudong <[email protected]>
Co-authored-by: JujieX <[email protected]>
Co-authored-by: singlecoder <[email protected]>
Co-authored-by: shensi.zxd <[email protected]>
Co-authored-by: luzhuang <[email protected]>

* v0.6.0-alpha.0

* refactor: fix physics package.json

* refactor: fix physics package.json (#575)

* v0.6.0-alpha.1

Co-authored-by: yangfengzzz <[email protected]>
Co-authored-by: JujieX <[email protected]>
Co-authored-by: Hu Song <[email protected]>
Co-authored-by: zhuxudong <[email protected]>
Co-authored-by: singlecoder <[email protected]>
Co-authored-by: luzhuang <[email protected]>
Co-authored-by: Bob <[email protected]>
Co-authored-by: shensi.zxd <[email protected]>
Co-authored-by: AZhan <[email protected]>
luzhuang pushed a commit to luzhuang/engine that referenced this pull request Sep 6, 2022
* feat: add rotateAxisAngle for Quaternion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants