当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript vec3.lerp方法代码示例

本文整理汇总了TypeScript中gl-matrix.vec3.lerp方法的典型用法代码示例。如果您正苦于以下问题:TypeScript vec3.lerp方法的具体用法?TypeScript vec3.lerp怎么用?TypeScript vec3.lerp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gl-matrix.vec3的用法示例。


在下文中一共展示了vec3.lerp方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: constructor

 constructor(
   readonly type: BoneType,
   readonly basis: Triple<vec3>,
   readonly prevJoint: vec3,
   readonly nextJoint: vec3,
   readonly width: number
 ) {
   const difference = vec3.subtract(vec3.create(), this.nextJoint, this.prevJoint);
   this.length = vec3.length(difference);
   this.basisMatrix = mat3.fromValues(
     this.basis[0][0], this.basis[0][1], this.basis[0][2],
     this.basis[1][0], this.basis[1][1], this.basis[1][2],
     this.basis[2][0], this.basis[2][1], this.basis[2][2]
   );
   this.left = mat3.determinant(this.basisMatrix) < 0;
   this.center = vec3.lerp(vec3.create(), this.prevJoint, this.nextJoint, 0.5);
   this.direction = Bone.createBoneDirection(this.basisMatrix);
   this.matrix = Bone.createBoneMatrix(this.basisMatrix, this.center, this.left);
 }
开发者ID:alexeden,项目名称:dotstar-node,代码行数:19,代码来源:bone.ts

示例2:

outVec3 = vec3.scale(outVec3, vec3A, 2);
outVec3 = vec3.scaleAndAdd(outVec3, vec3A, vec3B, 0.5);
outVal = vec3.distance(vec3A, vec3B);
outVal = vec3.dist(vec3A, vec3B);
outVal = vec3.squaredDistance(vec3A, vec3B);
outVal = vec3.sqrDist(vec3A, vec3B);
outVal = vec3.length(vec3A);
outVal = vec3.len(vec3A);
outVal = vec3.squaredLength(vec3A);
outVal = vec3.sqrLen(vec3A);
outVec3 = vec3.negate(outVec3, vec3A);
outVec3 = vec3.inverse(outVec3, vec3A);
outVec3 = vec3.normalize(outVec3, vec3A);
outVal = vec3.dot(vec3A, vec3B);
outVec3 = vec3.cross(outVec3, vec3A, vec3B);
outVec3 = vec3.lerp(outVec3, vec3A, vec3B, 0.5);
outVec3 = vec3.hermite(outVec3, vec3A, vec3B, vec3A, vec3B, 0.5);
outVec3 = vec3.bezier(outVec3, vec3A, vec3B, vec3A, vec3B, 0.5);
outVec3 = vec3.random(outVec3);
outVec3 = vec3.random(outVec3, 5.0);
outVec3 = vec3.transformMat3(outVec3, vec3A, mat3A);
outVec3 = vec3.transformMat4(outVec3, vec3A, mat4A);
outVec3 = vec3.transformQuat(outVec3, vec3A, quatA);
outVec3 = vec3.rotateX(outVec3, vec3A, vec3B, Math.PI);
outVec3 = vec3.rotateY(outVec3, vec3A, vec3B, Math.PI);
outVec3 = vec3.rotateZ(outVec3, vec3A, vec3B, Math.PI);
vecArray = vec3.forEach(vecArray, 0, 0, 0, vec3.normalize);
outVal = vec3.angle(vec3A, vec3B);
outStr = vec3.str(vec3A);
outBool = vec3.exactEquals(vec3A, vec3B);
outBool = vec3.equals(vec3A, vec3B);
开发者ID:DenisCarriere,项目名称:DefinitelyTyped,代码行数:31,代码来源:gl-matrix-tests.ts

示例3: lerp

 lerp(out: vec3, t: number) {
   return vec3.lerp(out, this.prevJoint, this.nextJoint, t);
 }
开发者ID:alexeden,项目名称:dotstar-node,代码行数:3,代码来源:bone.ts


注:本文中的gl-matrix.vec3.lerp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。