本文整理汇总了Java中rajawali.bounds.BoundingBox.getTransformedMax方法的典型用法代码示例。如果您正苦于以下问题:Java BoundingBox.getTransformedMax方法的具体用法?Java BoundingBox.getTransformedMax怎么用?Java BoundingBox.getTransformedMax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rajawali.bounds.BoundingBox
的用法示例。
在下文中一共展示了BoundingBox.getTransformedMax方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: intersectsWith
import rajawali.bounds.BoundingBox; //导入方法依赖的package包/类
private boolean intersectsWith(BoundingBox bbox) {
Number3D raySta = mRayStart;
Number3D rayEnd = mRayEnd;
Number3D boxMin = bbox.getTransformedMin();
Number3D boxMax = bbox.getTransformedMax();
if (rayEnd.x < boxMin.x && raySta.x < boxMin.x) return false;
if (rayEnd.x > boxMax.x && raySta.x > boxMax.x) return false;
if (rayEnd.y < boxMin.y && raySta.y < boxMin.y) return false;
if (rayEnd.y > boxMax.y && raySta.y > boxMax.y) return false;
if (rayEnd.z < boxMin.z && raySta.z < boxMin.z) return false;
if (rayEnd.z > boxMax.z && raySta.z > boxMax.z) return false;
if (raySta.x > boxMin.x && raySta.x < boxMax.x &&
raySta.y > boxMin.y && raySta.y < boxMax.y &&
raySta.z > boxMin.z && raySta.z < boxMax.z) {
mHitPoint.setAllFrom(raySta);
return true;
}
if ((getIntersection(raySta.x - boxMin.x, rayEnd.x - boxMin.x, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.X))
|| (getIntersection(raySta.y - boxMin.y, rayEnd.y - boxMin.y, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Y))
|| (getIntersection(raySta.z - boxMin.z, rayEnd.z - boxMin.z, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Z))
|| (getIntersection(raySta.x - boxMax.x, rayEnd.x - boxMax.x, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.X))
|| (getIntersection(raySta.y - boxMax.y, rayEnd.y - boxMax.y, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Y))
|| (getIntersection(raySta.z - boxMax.z, rayEnd.z - boxMax.z, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Z)))
return true;
return false;
}
示例2: intersectsWith
import rajawali.bounds.BoundingBox; //导入方法依赖的package包/类
private boolean intersectsWith(BoundingBox bbox) {
Vector3 raySta = mRayStart;
Vector3 rayEnd = mRayEnd;
Vector3 boxMin = bbox.getTransformedMin();
Vector3 boxMax = bbox.getTransformedMax();
if (rayEnd.x < boxMin.x && raySta.x < boxMin.x) return false;
if (rayEnd.x > boxMax.x && raySta.x > boxMax.x) return false;
if (rayEnd.y < boxMin.y && raySta.y < boxMin.y) return false;
if (rayEnd.y > boxMax.y && raySta.y > boxMax.y) return false;
if (rayEnd.z < boxMin.z && raySta.z < boxMin.z) return false;
if (rayEnd.z > boxMax.z && raySta.z > boxMax.z) return false;
if (raySta.x > boxMin.x && raySta.x < boxMax.x &&
raySta.y > boxMin.y && raySta.y < boxMax.y &&
raySta.z > boxMin.z && raySta.z < boxMax.z)
{mHitPoint.setAll(raySta);
return true;}
if ( (getIntersection(raySta.x-boxMin.x, rayEnd.x-boxMin.x, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.X))
|| (getIntersection(raySta.y-boxMin.y, rayEnd.y-boxMin.y, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Y))
|| (getIntersection(raySta.z-boxMin.z, rayEnd.z-boxMin.z, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Z))
|| (getIntersection(raySta.x-boxMax.x, rayEnd.x-boxMax.x, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.X))
|| (getIntersection(raySta.y-boxMax.y, rayEnd.y-boxMax.y, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Y))
|| (getIntersection(raySta.z-boxMax.z, rayEnd.z-boxMax.z, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Z)))
return true;
return false;
}
示例3: contains
import rajawali.bounds.BoundingBox; //导入方法依赖的package包/类
public boolean contains(IBoundingVolume boundingVolume) {
if(!(boundingVolume instanceof BoundingBox)) return false;
BoundingBox boundingBox = (BoundingBox)boundingVolume;
Vector3 otherMin = boundingBox.getTransformedMin();
Vector3 otherMax = boundingBox.getTransformedMax();
Vector3 min = mTransformedMin;
Vector3 max = mTransformedMax;
return (max.x >= otherMax.x) && (min.x <= otherMin.x) &&
(max.y >= otherMax.y) && (min.y <= otherMin.y) &&
(max.z >= otherMax.z) && (min.z <= otherMin.z);
}
示例4: isContainedBy
import rajawali.bounds.BoundingBox; //导入方法依赖的package包/类
public boolean isContainedBy(IBoundingVolume boundingVolume) {
if(!(boundingVolume instanceof BoundingBox)) return false;
BoundingBox boundingBox = (BoundingBox)boundingVolume;
Vector3 otherMin = boundingBox.getTransformedMin();
Vector3 otherMax = boundingBox.getTransformedMax();
Vector3 min = mTransformedMin;
Vector3 max = mTransformedMax;
return (max.x <= otherMax.x) && (min.x >= otherMin.x) &&
(max.y <= otherMax.y) && (min.y >= otherMin.y) &&
(max.z <= otherMax.z) && (min.z >= otherMin.z);
}
示例5: intersectsWith
import rajawali.bounds.BoundingBox; //导入方法依赖的package包/类
private boolean intersectsWith(BoundingBox bbox) {
Number3D raySta = mRayStart;
Number3D rayEnd = mRayEnd;
Number3D boxMin = bbox.getTransformedMin();
Number3D boxMax = bbox.getTransformedMax();
if (rayEnd.x < boxMin.x && raySta.x < boxMin.x) return false;
if (rayEnd.x > boxMax.x && raySta.x > boxMax.x) return false;
if (rayEnd.y < boxMin.y && raySta.y < boxMin.y) return false;
if (rayEnd.y > boxMax.y && raySta.y > boxMax.y) return false;
if (rayEnd.z < boxMin.z && raySta.z < boxMin.z) return false;
if (rayEnd.z > boxMax.z && raySta.z > boxMax.z) return false;
if (raySta.x > boxMin.x && raySta.x < boxMax.x &&
raySta.y > boxMin.y && raySta.y < boxMax.y &&
raySta.z > boxMin.z && raySta.z < boxMax.z)
{mHitPoint.setAllFrom(raySta);
return true;}
if ( (getIntersection(raySta.x-boxMin.x, rayEnd.x-boxMin.x, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.X))
|| (getIntersection(raySta.y-boxMin.y, rayEnd.y-boxMin.y, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Y))
|| (getIntersection(raySta.z-boxMin.z, rayEnd.z-boxMin.z, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Z))
|| (getIntersection(raySta.x-boxMax.x, rayEnd.x-boxMax.x, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.X))
|| (getIntersection(raySta.y-boxMax.y, rayEnd.y-boxMax.y, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Y))
|| (getIntersection(raySta.z-boxMax.z, rayEnd.z-boxMax.z, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Z)))
return true;
return false;
}
示例6: grow
import rajawali.bounds.BoundingBox; //导入方法依赖的package包/类
/**
* Grows the tree.
*/
protected void grow() {
RajLog.d("[" + this.getClass().getName() + "] Growing tree: " + this);
Vector3 min = new Vector3(Float.MAX_VALUE, Float.MAX_VALUE, Float.MAX_VALUE);
Vector3 max = new Vector3(-Float.MAX_VALUE, -Float.MAX_VALUE, -Float.MAX_VALUE);
//Get a full list of all the members, including members in the children
ArrayList<IGraphNodeMember> members = getAllMembersRecursively(true);
int members_count = members.size();
for (int i = 0; i < members_count; ++i) {
IBoundingVolume volume = members.get(i).getTransformedBoundingVolume();
Vector3 test_against_min = null;
Vector3 test_against_max = null;
if (volume == null) {
ATransformable3D object = (ATransformable3D) members.get(i);
test_against_min = object.getPosition();
test_against_max = test_against_min;
} else {
if (volume instanceof BoundingBox) {
BoundingBox bb = (BoundingBox) volume;
test_against_min = bb.getTransformedMin();
test_against_max = bb.getTransformedMax();
} else if (volume instanceof BoundingSphere) {
BoundingSphere bs = (BoundingSphere) volume;
Vector3 bs_position = bs.getPosition();
double radius = bs.getScaledRadius();
Vector3 rad = new Vector3();
rad.setAll(radius, radius, radius);
test_against_min = Vector3.subtractAndCreate(bs_position, rad);
test_against_max = Vector3.addAndCreate(bs_position, rad);
} else {
RajLog.e("[" + this.getClass().getName() + "] Received a bounding box of unknown type.");
throw new IllegalArgumentException("Received a bounding box of unknown type.");
}
}
if (test_against_min != null && test_against_max != null) {
if(test_against_min.x < min.x) min.x = test_against_min.x;
if(test_against_min.y < min.y) min.y = test_against_min.y;
if(test_against_min.z < min.z) min.z = test_against_min.z;
if(test_against_max.x > max.x) max.x = test_against_max.x;
if(test_against_max.y > max.y) max.y = test_against_max.y;
if(test_against_max.z > max.z) max.z = test_against_max.z;
}
}
mMin.setAll(min);
mMax.setAll(max);
mTransformedMin.setAll(min);
mTransformedMax.setAll(max);
calculatePoints();
calculateChildSideLengths();
if (mSplit) {
for (int i = 0; i < CHILD_COUNT; ++i) {
((Octree) mChildren[i]).setChildRegion(i, mChildLengths);
}
}
for (int i = 0; i < members_count; ++i) {
internalAddObject(members.get(i));
}
}