-
-
Notifications
You must be signed in to change notification settings - Fork 303
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
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
packages/math/src/Quaternion.ts
Outdated
* @returns This quaternion | ||
*/ | ||
rotateAxisAngle(axis: Vector3, rad: number): Quaternion { | ||
Quaternion._tempQuat1.rotateAxisAngle(axis, rad); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a /** @internal */
comment.
packages/math/src/Quaternion.ts
Outdated
@@ -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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
* 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]>
* feat: add rotateAxisAngle for Quaternion
Please check if the PR fulfills these requirements
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: