![]() |
TAPs 0.7.7.3
|
#include "../Core/TAPsListOfNamespaces.hpp"
Include dependency graph for TAPsCUDA_UsefulDeviceFns.cu:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| struct | matrix3x3 |
| 3-by-3 Matrix More... | |
| struct | matrix4x4 |
| 4-by-4 Matrix More... | |
Defines | |
| #define | TAPs_CUDA_USEFUL_DEVICE_FNS_HPP |
Functions | |
| BEGIN_NAMESPACE_TAPs__CUDA __device__ float3 | operator+ (const float3 &a, const float3 &b) |
| __device__ float3 | operator- (const float3 &a, const float3 &b) |
| __device__ float3 | operator* (const float3 &a, float s) |
| __device__ float3 | operator* (float s, const float3 &a) |
| __device__ float3 | operator/ (const float3 &a, float s) |
| __device__ float4 | operator+ (const float4 &a, const float4 &b) |
| __device__ float4 | operator- (const float4 &a, const float4 &b) |
| __device__ float4 | operator* (const float4 &a, float s) |
| __device__ float4 | operator* (float s, const float4 &a) |
| __device__ float4 | operator/ (const float4 &a, float s) |
| __device__ struct matrix3x3 | make_matrix3x3 (float e00, float e01, float e02, float e10, float e11, float e12, float e20, float e21, float e22) |
| __device__ struct matrix3x3 | operator+ (const struct matrix3x3 &A, const struct matrix3x3 &B) |
| __device__ struct matrix3x3 | operator- (const struct matrix3x3 &A, const struct matrix3x3 &B) |
| __device__ struct matrix3x3 | operator* (const struct matrix3x3 &A, float s) |
| __device__ struct matrix3x3 | operator/ (const struct matrix3x3 &A, float s) |
| __device__ struct matrix4x4 | make_matrix4x4 (float e00, float e01, float e02, float e03, float e10, float e11, float e12, float e13, float e20, float e21, float e22, float e23, float e30, float e31, float e32, float e33) |
| __device__ struct matrix4x4 | operator+ (const struct matrix4x4 &A, const struct matrix4x4 &B) |
| __device__ struct matrix4x4 | operator- (const struct matrix4x4 &A, const struct matrix4x4 &B) |
| __device__ struct matrix4x4 | operator* (const struct matrix4x4 &A, float s) |
| __device__ struct matrix4x4 | operator/ (const struct matrix4x4 &A, float s) |
| __device__ float4 | operator* (const struct matrix4x4 &A, const float4 &v) |
| __device__ float3 | XYZ (const float4 &V) |
| Return the float3 from a float4 by stripping the w component. | |
| __device__ float4 | XYZW (const float4 &V, float w) |
| Return the float4 from a float3 by adding w component. | |
| __device__ float3 | Add (const float3 &V, const float3 &W) |
| Return V+W; both V and W are float3. | |
| __device__ float4 | Add (const float4 &V, const float4 &W) |
| Return V+W; both V and W are float4. | |
| __device__ float3 | Sub (const float3 &V, const float3 &W) |
| Return V-W; both V and W are float3. | |
| __device__ float4 | Sub (const float4 &V, const float4 &W) |
| Return V-W; both V and W are float4. | |
| __device__ float | InnerProduct (const float3 &V, const float3 &W) |
| __device__ float | InnerProduct (const float4 &V, const float4 &W) |
| __device__ float3 | Mul (const float3 &V, float s) |
| Return s*V; V is float3. | |
| __device__ float4 | Mul (const float4 &V, float s) |
| Return s*V; V is float4. | |
| __device__ float3 | Div (const float3 &V, float s) |
| Return (1/s)*V; V is float3. | |
| __device__ float4 | Div (const float4 &V, float s) |
| Return (1/s)*V; V is float4. | |
| __device__ float | LengthSquare (const float3 &V) |
| Return the length square of V; V is float3. | |
| __device__ float | LengthSquare (const float4 &V) |
| Return the length square of V; V is float4. | |
| __device__ float | Length (const float3 &V) |
| Return the length of V; V is float3. | |
| __device__ float | Length (const float4 &V) |
| Return the length of V; V is float4. | |
| __device__ float3 | Unit (const float3 &V) |
| Return the unit vector of V; V is float3. | |
| __device__ float4 | Unit (const float4 &V) |
| Return the unit vector of V; V is float4. | |
| __device__ float4 | QuaternionConjugate (const float4 &Q) |
| The conjugation of quaternion. | |
| __device__ float | QuaternionNormSquare (const float4 &Q) |
| The norm square of quaternion. | |
| __device__ float | QuaternionNorm (const float4 &Q) |
| The norm of quaternion. | |
| __device__ float4 | QuaternionUnit (const float4 &Q) |
| The unit of quaternion. | |
| __device__ float4 | QuaternionMul (const float4 &Q1, const float4 &Q2) |
| Quaternion Multiplication. | |
| __device__ struct matrix3x3 | QuatenionToRotationMatrix3x3 (const float4 &Q) |
| Quaternion to 3-by-3 Rotation Matrix. | |
| __device__ struct matrix4x4 | QuatenionToRotationMatrix4x4 (const float4 &Q) |
| Quaternion to 4-by-4 Rotation Matrix. | |
"CUDA/TAPsCUDA_UsefulDeviceFns.cu" A collection of useful CUDA's device functions and data structure, such as matrix4x4 and Quaternion
Definition in file TAPsCUDA_UsefulDeviceFns.cu.
| #define TAPs_CUDA_USEFUL_DEVICE_FNS_HPP |
Definition at line 12 of file TAPsCUDA_UsefulDeviceFns.cu.
| __device__ float3 Add | ( | const float3 & | V, |
| const float3 & | W | ||
| ) |
Return V+W; both V and W are float3.
Definition at line 315 of file TAPsCUDA_UsefulDeviceFns.cu.
Referenced by Device__CalBendTorque_ModelElasticRod(), Device__EulerInt_NewOri_ModelElasticRod(), Device__EulerInt_NewPos_ModelElasticRod(), and Device__EulerInt_NewVel_ModelElasticRod().
{
return make_float3( V.x+W.x, V.y+W.y, V.z+W.z );
}
Here is the caller graph for this function:| __device__ float4 Add | ( | const float4 & | V, |
| const float4 & | W | ||
| ) |
Return V+W; both V and W are float4.
Definition at line 322 of file TAPsCUDA_UsefulDeviceFns.cu.
{
return make_float4( V.x+W.x, V.y+W.y, V.z+W.z, V.w+W.w );
}
| __device__ float3 Div | ( | const float3 & | V, |
| float | s | ||
| ) |
Return (1/s)*V; V is float3.
Definition at line 373 of file TAPsCUDA_UsefulDeviceFns.cu.
Referenced by QuaternionUnit(), and Unit().
{
return make_float3( V.x/s, V.y/s, V.z/s );
}
Here is the caller graph for this function:| __device__ float4 Div | ( | const float4 & | V, |
| float | s | ||
| ) |
Return (1/s)*V; V is float4.
Definition at line 380 of file TAPsCUDA_UsefulDeviceFns.cu.
{
return make_float4( V.x/s, V.y/s, V.z/s, V.w/s );
}
| __device__ float InnerProduct | ( | const float3 & | V, |
| const float3 & | W | ||
| ) |
Return <V,W>, i.e. the dot or inner product of V and W; both V and W are float3
Definition at line 344 of file TAPsCUDA_UsefulDeviceFns.cu.
Referenced by Device__CalBendTorque_ModelElasticRod(), Device__CalTheConstraintForce_ModelElasticRod(), Device__CalTheConstraintTorque_ModelElasticRod(), and LengthSquare().
{
return V.x*W.x + V.y*W.y + V.z*W.z;
}
Here is the caller graph for this function:| __device__ float InnerProduct | ( | const float4 & | V, |
| const float4 & | W | ||
| ) |
Return <V,W>, i.e. the dot or inner product of V and W; both V and W are float4
Definition at line 352 of file TAPsCUDA_UsefulDeviceFns.cu.
{
return V.x*W.x + V.y*W.y + V.z*W.z + V.w*W.w;
}
| __device__ float Length | ( | const float3 & | V | ) |
Return the length of V; V is float3.
Definition at line 401 of file TAPsCUDA_UsefulDeviceFns.cu.
References LengthSquare().
Referenced by OpenWound_TycoEndostitch_V2< T, DATA >::AddInterpolatedPuncturedLocations(), CD_PolygonalMesh_vs_LineSegment(), CDR_PolygonalMesh_vs_BV(), CDR_PolygonalMesh_vs_MBV(), CDR_Strand_vs_DeformMesh(), CDR_Suture_vs_DeformMesh(), ElasticRodCD< T >::CDRbySegmentsWith(), CDRigid_PolygonalMesh_vs_MBV(), ElasticRodCD< T >::CDRwith(), ModelElasticRod< T >::ComputeLengthOfCenterlineSegment(), ModelElasticRod< T >::ComputeLengthOfOrientationSegment(), ModelDefBasedOnFEM_CD< T >::CORE_CDwith(), BVHTree_BinarySphere< T >::CreateBVHNodeBSphere(), Cloth< T >::CreateSprings(), Device__CalForce_ModelElasticRod(), Device__CalTorque_ModelElasticRod(), AdvSimConstraints< T >::EnforceConstrainedModelER_A(), AdvSimConstraints< T >::EnforceConstraints_A(), AdvSimConstraints< T >::EnforceConstraints_A__NotForMultiGrp(), CGMath< T >::FindIfACircleIntersectsATriangleOnTheSamePlane(), CGMath< T >::FindIntersectionLineSegmentLineSegment(), CGMath< T >::FindProjectedPointOnALine(), ModelSurgicalSutureWithHeadNeedle< T >::FindTheClosestPointToPoint(), ModelElasticRod< T >::FindTheClosestPointToPoint(), BVHTree_BinarySphere< T >::ForBVSphereTransformations(), SpringVertex< T >::GetCurrentLength(), SpringRef< T >::GetCurrentLength(), Spring< T >::GetCurrentLength(), ModelDeformableCPU< T >::GetTheClosestElementToThePosition(), ImplicitObject_Torus< T >::GetTransformedRadii(), ImplicitObject_Sphere< T >::GetTransformedRadius(), ModelDefBasedOnFEM_CD< T >::GrabbedBy(), ModelElasticRod< T >::InitializeElasticRodNodes(), Vector< T, N >::Magnitude(), SPtVector3< T >::Norm(), AdvSimSupport_DS< T, DATA >::ProcessForwardPuncturingIPGonRBDModelToHexFEMModel_SectionPunctured(), AdvSimConstraint_ForModelSurgicalSutureWithHeadNeedle< T, DATA >::ProcessLockedPuncturePath(), AdvSimConstraint_ForModelSurgicalSutureWithHeadNeedle< T, DATA >::ProcessLockedPuncturePath_MoreAccuButUnfinishYet(), AdvSimConstraint_ForModelSurgicalSutureWithHeadNeedle< T, DATA >::ProcessPuncturingOfHeadNeedleRepresentedByIPGWithFEMModel(), AdvSimConstraint_ForModelSurgicalSutureWithHeadNeedle< T, DATA >::RecordAndLockThePuncturePath(), AdvSimConstraint_ForModelSurgicalSutureWithHeadNeedle< T, DATA >::RecordAndLockThePuncturePath_MoreAccuButUnfinishYet(), AdvSimSupport_DS< T, DATA >::SetERNodesForwardBackwardMovement_InteractHEModel(), CGMath< T >::SolveAForConstCubicBezierCurveLength(), BVHNode< T >::TestOverlapSphereWithBVCylinder_AtOrigin_NoPrimitiveTests(), BVHNode< T >::TestOverlapSphereWithSphere_NoPrimitiveTests(), BVHNodeLeafHalfEdgeAPrim< T >::TestOverlapWith(), BVHNodeLeaf< T >::TestOverlapWith(), Unit(), ElasticRodCD< T >::UpdateBVHNodeRecursively(), BVHNodeLeafHalfEdgeAPrim< T >::UpdateSphere(), BVHNodeLeafALinkFormedByTwoPointMasses< T >::UpdateSphere(), and OpenGLViewManager< T >::UpdateWindowToWorldScale().
{
return sqrtf( LengthSquare( V ) );
}
Here is the call graph for this function:| __device__ float Length | ( | const float4 & | V | ) |
Return the length of V; V is float4.
Definition at line 408 of file TAPsCUDA_UsefulDeviceFns.cu.
References LengthSquare().
{
return sqrtf( LengthSquare( V ) );
}
Here is the call graph for this function:| __device__ float LengthSquare | ( | const float3 & | V | ) |
Return the length square of V; V is float3.
Definition at line 387 of file TAPsCUDA_UsefulDeviceFns.cu.
References InnerProduct().
Referenced by Length().
{
return InnerProduct( V, V );
}
Here is the call graph for this function:
Here is the caller graph for this function:| __device__ float LengthSquare | ( | const float4 & | V | ) |
Return the length square of V; V is float4.
Definition at line 394 of file TAPsCUDA_UsefulDeviceFns.cu.
References InnerProduct().
{
return InnerProduct( V, V );
}
Here is the call graph for this function:| __device__ struct matrix3x3 make_matrix3x3 | ( | float | e00, |
| float | e01, | ||
| float | e02, | ||
| float | e10, | ||
| float | e11, | ||
| float | e12, | ||
| float | e20, | ||
| float | e21, | ||
| float | e22 | ||
| ) | [read] |
Definition at line 150 of file TAPsCUDA_UsefulDeviceFns.cu.
References matrix3x3::col.
Referenced by QuatenionToRotationMatrix3x3().
{
struct matrix3x3 A;
A.col[0].x = e00; A.col[0].y = e10; A.col[0].z = e20;
A.col[1].x = e01; A.col[1].y = e11; A.col[1].z = e21;
A.col[2].x = e02; A.col[2].y = e12; A.col[2].z = e22;
return A;
}
Here is the caller graph for this function:| __device__ struct matrix4x4 make_matrix4x4 | ( | float | e00, |
| float | e01, | ||
| float | e02, | ||
| float | e03, | ||
| float | e10, | ||
| float | e11, | ||
| float | e12, | ||
| float | e13, | ||
| float | e20, | ||
| float | e21, | ||
| float | e22, | ||
| float | e23, | ||
| float | e30, | ||
| float | e31, | ||
| float | e32, | ||
| float | e33 | ||
| ) | [read] |
Definition at line 220 of file TAPsCUDA_UsefulDeviceFns.cu.
References matrix4x4::col.
Referenced by QuatenionToRotationMatrix4x4().
{
struct matrix4x4 A;
A.col[0].x = e00; A.col[0].y = e10; A.col[0].z = e20; A.col[0].w = e30;
A.col[1].x = e01; A.col[1].y = e11; A.col[1].z = e21; A.col[1].w = e31;
A.col[2].x = e02; A.col[2].y = e12; A.col[2].z = e22; A.col[2].w = e32;
A.col[3].x = e03; A.col[3].y = e13; A.col[3].z = e23; A.col[3].w = e33;
return A;
}
Here is the caller graph for this function:| __device__ float3 Mul | ( | const float3 & | V, |
| float | s | ||
| ) |
Return s*V; V is float3.
Definition at line 359 of file TAPsCUDA_UsefulDeviceFns.cu.
Referenced by Device__CalBendTorque_ModelElasticRod(), Device__CalTheConstraintForce_ModelElasticRod(), Device__CalTheConstraintTorque_ModelElasticRod(), Device__EulerInt_NewOri_ModelElasticRod(), Device__EulerInt_NewPos_ModelElasticRod(), and Device__EulerInt_NewVel_ModelElasticRod().
{
return make_float3( V.x*s, V.y*s, V.z*s );
}
Here is the caller graph for this function:| __device__ float4 Mul | ( | const float4 & | V, |
| float | s | ||
| ) |
Return s*V; V is float4.
Definition at line 366 of file TAPsCUDA_UsefulDeviceFns.cu.
{
return make_float4( V.x*s, V.y*s, V.z*s, V.w*s );
}
| __device__ float3 operator* | ( | const float3 & | a, |
| float | s | ||
| ) |
Definition at line 61 of file TAPsCUDA_UsefulDeviceFns.cu.
{
float3 c;
c.x = a.x * s;
c.y = a.y * s;
c.z = a.z * s;
return c;
}
| __device__ float4 operator* | ( | const float4 & | a, |
| float | s | ||
| ) |
Definition at line 111 of file TAPsCUDA_UsefulDeviceFns.cu.
{
float4 c;
c.x = a.x * s;
c.y = a.y * s;
c.z = a.z * s;
c.w = a.w * s;
return c;
}
| __device__ float4 operator* | ( | float | s, |
| const float4 & | a | ||
| ) |
Definition at line 122 of file TAPsCUDA_UsefulDeviceFns.cu.
{
return a * s;
}
Definition at line 258 of file TAPsCUDA_UsefulDeviceFns.cu.
References matrix4x4::col.
| __device__ float3 operator* | ( | float | s, |
| const float3 & | a | ||
| ) |
Definition at line 71 of file TAPsCUDA_UsefulDeviceFns.cu.
{
return a * s;
}
| __device__ float4 operator* | ( | const struct matrix4x4 & | A, |
| const float4 & | v | ||
| ) |
Definition at line 280 of file TAPsCUDA_UsefulDeviceFns.cu.
References matrix4x4::col.
{
float4 r = make_float4(
A.col[0].x*v.x + A.col[1].x*v.y + A.col[2].x*v.z + A.col[3].x*v.w,
A.col[0].y*v.x + A.col[1].y*v.y + A.col[2].y*v.z + A.col[3].y*v.w,
A.col[0].z*v.x + A.col[1].z*v.y + A.col[2].z*v.z + A.col[3].z*v.w,
A.col[0].w*v.x + A.col[1].w*v.y + A.col[2].w*v.z + A.col[3].w*v.w
);
return r;
}
Definition at line 186 of file TAPsCUDA_UsefulDeviceFns.cu.
References matrix3x3::col.
| __device__ struct matrix4x4 operator+ | ( | const struct matrix4x4 & | A, |
| const struct matrix4x4 & | B | ||
| ) | [read] |
Definition at line 236 of file TAPsCUDA_UsefulDeviceFns.cu.
References matrix4x4::col.
| __device__ struct matrix3x3 operator+ | ( | const struct matrix3x3 & | A, |
| const struct matrix3x3 & | B | ||
| ) | [read] |
Definition at line 164 of file TAPsCUDA_UsefulDeviceFns.cu.
References matrix3x3::col.
| __device__ float4 operator+ | ( | const float4 & | a, |
| const float4 & | b | ||
| ) |
Definition at line 89 of file TAPsCUDA_UsefulDeviceFns.cu.
{
float4 c;
c.x = a.x + b.x;
c.y = a.y + b.y;
c.z = a.z + b.z;
c.w = a.w + b.w;
return c;
}
| BEGIN_NAMESPACE_TAPs__CUDA __device__ float3 operator+ | ( | const float3 & | a, |
| const float3 & | b | ||
| ) |
Definition at line 41 of file TAPsCUDA_UsefulDeviceFns.cu.
{
float3 c;
c.x = a.x + b.x;
c.y = a.y + b.y;
c.z = a.z + b.z;
return c;
}
| __device__ float3 operator- | ( | const float3 & | a, |
| const float3 & | b | ||
| ) |
Definition at line 51 of file TAPsCUDA_UsefulDeviceFns.cu.
{
float3 c;
c.x = a.x - b.x;
c.y = a.y - b.y;
c.z = a.z - b.z;
return c;
}
| __device__ struct matrix4x4 operator- | ( | const struct matrix4x4 & | A, |
| const struct matrix4x4 & | B | ||
| ) | [read] |
Definition at line 247 of file TAPsCUDA_UsefulDeviceFns.cu.
References matrix4x4::col.
| __device__ struct matrix3x3 operator- | ( | const struct matrix3x3 & | A, |
| const struct matrix3x3 & | B | ||
| ) | [read] |
Definition at line 175 of file TAPsCUDA_UsefulDeviceFns.cu.
References matrix3x3::col.
| __device__ float4 operator- | ( | const float4 & | a, |
| const float4 & | b | ||
| ) |
Definition at line 100 of file TAPsCUDA_UsefulDeviceFns.cu.
{
float4 c;
c.x = a.x - b.x;
c.y = a.y - b.y;
c.z = a.z - b.z;
c.w = a.w - b.w;
return c;
}
Definition at line 269 of file TAPsCUDA_UsefulDeviceFns.cu.
References matrix4x4::col.
| __device__ float4 operator/ | ( | const float4 & | a, |
| float | s | ||
| ) |
Definition at line 128 of file TAPsCUDA_UsefulDeviceFns.cu.
{
float4 c;
c.x = a.x / s;
c.y = a.y / s;
c.z = a.z / s;
c.w = a.w / s;
return c;
}
| __device__ float3 operator/ | ( | const float3 & | a, |
| float | s | ||
| ) |
Definition at line 77 of file TAPsCUDA_UsefulDeviceFns.cu.
{
float3 c;
c.x = a.x / s;
c.y = a.y / s;
c.z = a.z / s;
return c;
}
Definition at line 197 of file TAPsCUDA_UsefulDeviceFns.cu.
References matrix3x3::col.
| __device__ struct matrix3x3 QuatenionToRotationMatrix3x3 | ( | const float4 & | Q | ) | [read] |
Quaternion to 3-by-3 Rotation Matrix.
Definition at line 475 of file TAPsCUDA_UsefulDeviceFns.cu.
References make_matrix3x3().
{
float rr = Q.x*Q.x;
float ii = Q.y*Q.y;
float jj = Q.z*Q.z;
float kk = Q.w*Q.w;
float ri = Q.x*Q.y;
float rj = Q.x*Q.z;
float rk = Q.x*Q.w;
float ij = Q.y*Q.z;
float jk = Q.z*Q.w;
float ik = Q.y*Q.w;
struct matrix3x3 R = make_matrix3x3(
rr+ii-jj-kk, 2*(ij-rk), 2*(ik+rj),
2*(ij+rk), rr-ii+jj-kk, 2*(jk-ri),
2*(ik-rj), 2*(jk+ri), rr-ii-jj+kk
);
return R;
}
Here is the call graph for this function:| __device__ struct matrix4x4 QuatenionToRotationMatrix4x4 | ( | const float4 & | Q | ) | [read] |
Quaternion to 4-by-4 Rotation Matrix.
Definition at line 498 of file TAPsCUDA_UsefulDeviceFns.cu.
References make_matrix4x4().
Referenced by GL__GenCylinderForElasticRodModel_CU(), and GL__GenCylinderForElasticRodModel_PLHM_CU().
{
float rr = Q.x*Q.x;
float ii = Q.y*Q.y;
float jj = Q.z*Q.z;
float kk = Q.w*Q.w;
float ri = Q.x*Q.y;
float rj = Q.x*Q.z;
float rk = Q.x*Q.w;
float ij = Q.y*Q.z;
float jk = Q.z*Q.w;
float ik = Q.y*Q.w;
struct matrix4x4 R = make_matrix4x4(
rr+ii-jj-kk, 2*(ij-rk), 2*(ik+rj), 0,
2*(ij+rk), rr-ii+jj-kk, 2*(jk-ri), 0,
2*(ik-rj), 2*(jk+ri), rr-ii-jj+kk, 0,
0, 0, 0, 1
);
return R;
}
Here is the call graph for this function:
Here is the caller graph for this function:| __device__ float4 QuaternionConjugate | ( | const float4 & | Q | ) |
The conjugation of quaternion.
Definition at line 435 of file TAPsCUDA_UsefulDeviceFns.cu.
Referenced by Device__EulerInt_NewOri_ModelElasticRod().
{
return make_float4( Q.x, -Q.y, -Q.z, -Q.w );
}
Here is the caller graph for this function:| __device__ float4 QuaternionMul | ( | const float4 & | Q1, |
| const float4 & | Q2 | ||
| ) |
Quaternion Multiplication.
Definition at line 463 of file TAPsCUDA_UsefulDeviceFns.cu.
Referenced by Device__EulerInt_NewOri_ModelElasticRod().
{
return make_float4(
Q1.x*Q2.x - Q1.y*Q2.y - Q1.z*Q2.z - Q1.w*Q2.w,
Q1.x*Q2.y + Q1.y*Q2.x + Q1.z*Q2.w - Q1.w*Q2.z,
Q1.x*Q2.z + Q1.z*Q2.x + Q1.w*Q2.y - Q1.y*Q2.w,
Q1.x*Q2.w + Q1.w*Q2.x + Q1.y*Q2.z - Q1.z*Q2.y
);
}
Here is the caller graph for this function:| __device__ float QuaternionNorm | ( | const float4 & | Q | ) |
The norm of quaternion.
Definition at line 449 of file TAPsCUDA_UsefulDeviceFns.cu.
References QuaternionNormSquare().
Referenced by QuaternionUnit().
{
return sqrtf( QuaternionNormSquare( Q ) );
}
Here is the call graph for this function:
Here is the caller graph for this function:| __device__ float QuaternionNormSquare | ( | const float4 & | Q | ) |
The norm square of quaternion.
Definition at line 442 of file TAPsCUDA_UsefulDeviceFns.cu.
Referenced by QuaternionNorm().
{
return Q.x*Q.x + Q.y*Q.y + Q.z*Q.z + Q.w*Q.w;
}
Here is the caller graph for this function:| __device__ float4 QuaternionUnit | ( | const float4 & | Q | ) |
The unit of quaternion.
Definition at line 456 of file TAPsCUDA_UsefulDeviceFns.cu.
References Div(), and QuaternionNorm().
Referenced by Global__ModelElasticRod_AdvSim_CU(), and Global__ModelElasticRod_AdvSimPLHM_CU().
{
return Div( Q, QuaternionNorm(Q) );
}
Here is the call graph for this function:
Here is the caller graph for this function:| __device__ float3 Sub | ( | const float3 & | V, |
| const float3 & | W | ||
| ) |
Return V-W; both V and W are float3.
Definition at line 329 of file TAPsCUDA_UsefulDeviceFns.cu.
Referenced by Device__CalBendTorque_ModelElasticRod(), Device__CalForce_ModelElasticRod(), Device__CalTheConstraintForce_ModelElasticRod(), Device__CalTheConstraintTorque_ModelElasticRod(), and Device__CalTorque_ModelElasticRod().
{
return make_float3( V.x-W.x, V.y-W.y, V.z-W.z );
}
Here is the caller graph for this function:| __device__ float4 Sub | ( | const float4 & | V, |
| const float4 & | W | ||
| ) |
Return V-W; both V and W are float4.
Definition at line 336 of file TAPsCUDA_UsefulDeviceFns.cu.
{
return make_float4( V.x-W.x, V.y-W.y, V.z-W.z, V.w-W.w );
}
| __device__ float3 Unit | ( | const float3 & | V | ) |
| __device__ float4 Unit | ( | const float4 & | V | ) |
| __device__ float3 XYZ | ( | const float4 & | V | ) |
Return the float3 from a float4 by stripping the w component.
Definition at line 301 of file TAPsCUDA_UsefulDeviceFns.cu.
Referenced by Device__CalForce_ModelElasticRod(), Device__CalTorque_ModelElasticRod(), Global__ModelElasticRod_AdvSim_CU(), and Global__ModelElasticRod_AdvSimPLHM_CU().
{
return make_float3( V.x, V.y, V.z );
}
Here is the caller graph for this function:| __device__ float4 XYZW | ( | const float4 & | V, |
| float | w | ||
| ) |
Return the float4 from a float3 by adding w component.
Definition at line 308 of file TAPsCUDA_UsefulDeviceFns.cu.
{
return make_float4( V.x, V.y, V.z, w );
}