public virtual void projectOntoAxis(Point3f point) { // assumes axisA, axisB, and axisUnitVector are set; vectorProjection.sub(point, axisA); float projectedLength = vectorProjection.dot(axisUnitVector); point.set_Renamed(axisUnitVector); point.scaleAdd(projectedLength, axisA); }
/// <summary> Transforms the point parameter with this Matrix4f and places the result /// into pointOut. The fourth element of the point input paramter is assumed /// to be one. /// </summary> /// <param name="point">the input point to be transformed. /// </param> /// <param name="pointOut">the transformed point /// </param> public void transform(Point3f point, Point3f pointOut) { pointOut.set_Renamed(m00 * point.x + m01 * point.y + m02 * point.z + m03, m10 * point.x + m11 * point.y + m12 * point.z + m13, m20 * point.x + m21 * point.y + m22 * point.z + m23); }
public virtual void getLeadMidPoint(int groupIndex, Point3f midPoint) { if (groupIndex == monomerCount) { --groupIndex; } else if (groupIndex > 0) { midPoint.set_Renamed(getLeadPoint(groupIndex)); midPoint.add(getLeadPoint(groupIndex - 1)); midPoint.scale(0.5f); return ; } midPoint.set_Renamed(getLeadPoint(groupIndex)); }
public void calcAtomsMinMax(Point3f pointMin, Point3f pointMax) { float minX, minY, minZ, maxX, maxY, maxZ; Point3f pointT; pointT = atoms[0].point3f; minX = maxX = pointT.x; minY = maxY = pointT.y; minZ = maxZ = pointT.z; for (int i = atomCount; --i > 0; ) { // note that the 0 element was set above pointT = atoms[i].point3f; float t; t = pointT.x; if (t < minX) minX = t; else if (t > maxX) maxX = t; t = pointT.y; if (t < minY) minY = t; else if (t > maxY) maxY = t; t = pointT.z; if (t < minZ) minZ = t; else if (t > maxZ) maxZ = t; } pointMin.set_Renamed(minX, minY, minZ); pointMax.set_Renamed(maxX, maxY, maxZ); }
/// <summary> Transforms the point parameter with this Matrix4d and places the result /// into pointOut. The fourth element of the point input paramter is assumed /// to be one. /// </summary> /// <param name="point">the input point to be transformed. /// </param> /// <param name="pointOut">the transformed point /// </param> public void transform(Point3f point, Point3f pointOut) { //UPGRADE_WARNING: Data types in Visual C# might be different. Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'" pointOut.set_Renamed((float) (m00 * point.x + m01 * point.y + m02 * point.z + m03), (float) (m10 * point.x + m11 * point.y + m12 * point.z + m13), (float) (m20 * point.x + m21 * point.y + m22 * point.z + m23)); }