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


Java CollisionObjectType类代码示例

本文整理汇总了Java中com.bulletphysics.collision.dispatch.CollisionObjectType的典型用法代码示例。如果您正苦于以下问题:Java CollisionObjectType类的具体用法?Java CollisionObjectType怎么用?Java CollisionObjectType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CollisionObjectType类属于com.bulletphysics.collision.dispatch包,在下文中一共展示了CollisionObjectType类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: upcast

import com.bulletphysics.collision.dispatch.CollisionObjectType; //导入依赖的package包/类
/** To keep collision detection and dynamics separate we don't store a rigidbody pointer, but a rigidbody is derived from
 * CollisionObject, so we can safely perform an upcast. */
public static RigidBody upcast (CollisionObject colObj) {
	if (colObj.getInternalType() == CollisionObjectType.RIGID_BODY) {
		return (RigidBody)colObj;
	}
	return null;
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:9,代码来源:RigidBody.java

示例2: upcast

import com.bulletphysics.collision.dispatch.CollisionObjectType; //导入依赖的package包/类
/**
 * To keep collision detection and dynamics separate we don't store a rigidbody pointer,
 * but a rigidbody is derived from CollisionObject, so we can safely perform an upcast.
 */
public static RigidBody upcast(CollisionObject colObj) {
	if (colObj.getInternalType() == CollisionObjectType.RIGID_BODY) {
		return (RigidBody)colObj;
	}
	return null;
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:11,代码来源:RigidBody.java

示例3: setupRigidBody

import com.bulletphysics.collision.dispatch.CollisionObjectType; //导入依赖的package包/类
private void setupRigidBody (RigidBodyConstructionInfo constructionInfo) {
	internalType = CollisionObjectType.RIGID_BODY;

	linearVelocity.set(0f, 0f, 0f);
	angularVelocity.set(0f, 0f, 0f);
	linearFactor.set(1f, 1f, 1f);
	angularFactor.set(1f, 1f, 1f);
	gravity.set(0f, 0f, 0f);
	totalForce.set(0f, 0f, 0f);
	totalTorque.set(0f, 0f, 0f);
	linearDamping = 0f;
	angularDamping = 0.5f;
	linearSleepingThreshold = constructionInfo.linearSleepingThreshold;
	angularSleepingThreshold = constructionInfo.angularSleepingThreshold;
	optionalMotionState = constructionInfo.motionState;
	contactSolverType = 0;
	frictionSolverType = 0;
	additionalDamping = constructionInfo.additionalDamping;
	additionalDampingFactor = constructionInfo.additionalDampingFactor;
	additionalLinearDampingThresholdSqr = constructionInfo.additionalLinearDampingThresholdSqr;
	additionalAngularDampingThresholdSqr = constructionInfo.additionalAngularDampingThresholdSqr;
	additionalAngularDampingFactor = constructionInfo.additionalAngularDampingFactor;

	if (optionalMotionState != null) {
		optionalMotionState.getWorldTransform(worldTransform);
	} else {
		worldTransform.set(constructionInfo.startWorldTransform);
	}

	interpolationWorldTransform.set(worldTransform);
	interpolationLinearVelocity.set(0f, 0f, 0f);
	interpolationAngularVelocity.set(0f, 0f, 0f);

	// moved to CollisionObject
	friction = constructionInfo.friction;
	restitution = constructionInfo.restitution;

	setCollisionShape(constructionInfo.collisionShape);
	debugBodyId = uniqueId++;

	setMassProps(constructionInfo.mass, constructionInfo.localInertia);
	setDamping(constructionInfo.linearDamping, constructionInfo.angularDamping);
	updateInertiaTensor();
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:45,代码来源:RigidBody.java

示例4: setupRigidBody

import com.bulletphysics.collision.dispatch.CollisionObjectType; //导入依赖的package包/类
private void setupRigidBody(RigidBodyConstructionInfo constructionInfo) {
	internalType = CollisionObjectType.RIGID_BODY;
	
	linearVelocity.set(0f, 0f, 0f);
	angularVelocity.set(0f, 0f, 0f);
	angularFactor = 1f;
	gravity.set(0f, 0f, 0f);
	totalForce.set(0f, 0f, 0f);
	totalTorque.set(0f, 0f, 0f);
	linearDamping = 0f;
	angularDamping = 0.5f;
	linearSleepingThreshold = constructionInfo.linearSleepingThreshold;
	angularSleepingThreshold = constructionInfo.angularSleepingThreshold;
	optionalMotionState = constructionInfo.motionState;
	contactSolverType = 0;
	frictionSolverType = 0;
	additionalDamping = constructionInfo.additionalDamping;
	additionalDampingFactor = constructionInfo.additionalDampingFactor;
	additionalLinearDampingThresholdSqr = constructionInfo.additionalLinearDampingThresholdSqr;
	additionalAngularDampingThresholdSqr = constructionInfo.additionalAngularDampingThresholdSqr;
	additionalAngularDampingFactor = constructionInfo.additionalAngularDampingFactor;

	if (optionalMotionState != null)
	{
		optionalMotionState.getWorldTransform(worldTransform);
	} else
	{
		worldTransform.set(constructionInfo.startWorldTransform);
	}

	interpolationWorldTransform.set(worldTransform);
	interpolationLinearVelocity.set(0f, 0f, 0f);
	interpolationAngularVelocity.set(0f, 0f, 0f);

	// moved to CollisionObject
	friction = constructionInfo.friction;
	restitution = constructionInfo.restitution;

	setCollisionShape(constructionInfo.collisionShape);
	debugBodyId = uniqueId++;

	setMassProps(constructionInfo.mass, constructionInfo.localInertia);
	setDamping(constructionInfo.linearDamping, constructionInfo.angularDamping);
	updateInertiaTensor();
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:46,代码来源:RigidBody.java

示例5: setupRigidBody

import com.bulletphysics.collision.dispatch.CollisionObjectType; //导入依赖的package包/类
public void setupRigidBody(RigidBodyConstructionInfo constructionInfo) {
	internalType = CollisionObjectType.RIGID_BODY;
	
	linearVelocity.set(0f, 0f, 0f);
	angularVelocity.set(0f, 0f, 0f);
	angularFactor.set(1, 1, 1);
               linearFactor.set(1, 1, 1);
	gravity.set(0f, 0f, 0f);
	totalForce.set(0f, 0f, 0f);
	totalTorque.set(0f, 0f, 0f);
	linearDamping = 0f;
	angularDamping = 0.5f;
	linearSleepingThreshold = constructionInfo.linearSleepingThreshold;
	angularSleepingThreshold = constructionInfo.angularSleepingThreshold;
	optionalMotionState = constructionInfo.motionState;
	contactSolverType = 0;
	frictionSolverType = 0;
	additionalDamping = constructionInfo.additionalDamping;
	additionalDampingFactor = constructionInfo.additionalDampingFactor;
	additionalLinearDampingThresholdSqr = constructionInfo.additionalLinearDampingThresholdSqr;
	additionalAngularDampingThresholdSqr = constructionInfo.additionalAngularDampingThresholdSqr;
	additionalAngularDampingFactor = constructionInfo.additionalAngularDampingFactor;

	if (optionalMotionState != null)
	{
		optionalMotionState.getWorldTransform(worldTransform);
	} else
	{
		worldTransform.set(constructionInfo.startWorldTransform);
	}

	interpolationWorldTransform.set(worldTransform);
	interpolationLinearVelocity.set(0f, 0f, 0f);
	interpolationAngularVelocity.set(0f, 0f, 0f);

	// moved to CollisionObject
	friction = constructionInfo.friction;
	restitution = constructionInfo.restitution;

	setCollisionShape(constructionInfo.collisionShape);
	debugBodyId = uniqueId++;

	setMassProps(constructionInfo.mass, constructionInfo.localInertia);
	setDamping(constructionInfo.linearDamping, constructionInfo.angularDamping);
	updateInertiaTensor();
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:47,代码来源:RigidBody.java


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