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


C++ cpBodyActivate函数代码示例

本文整理汇总了C++中cpBodyActivate函数的典型用法代码示例。如果您正苦于以下问题:C++ cpBodyActivate函数的具体用法?C++ cpBodyActivate怎么用?C++ cpBodyActivate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: cpSpaceRemoveConstraint

void
cpSpaceRemoveConstraint(cpSpace *space, cpConstraint *constraint)
{
	cpAssertWarn(cpArrayContains(space->constraints, constraint),
		"Cannot remove a constraint that was not added to the space. (Removed twice maybe?)");
//	cpAssertSpaceUnlocked(space); Should be safe as long as its not from a constraint callback.
	
	cpBodyActivate(constraint->a);
	cpBodyActivate(constraint->b);
	cpArrayDeleteObj(space->constraints, constraint);
}
开发者ID:harad,项目名称:Last-Escape,代码行数:11,代码来源:cpSpace.c

示例2: cpSpaceRemoveConstraint

void
cpSpaceRemoveConstraint(cpSpace *space, cpConstraint *constraint)
{
	cpAssertHard(cpSpaceContainsConstraint(space, constraint), "Cannot remove a constraint that was not added to the space. (Removed twice maybe?)");
	cpAssertSpaceUnlocked(space);
	
	cpBodyActivate(constraint->a);
	cpBodyActivate(constraint->b);
	cpArrayDeleteObj(space->constraints, constraint);
	
	cpBodyRemoveConstraint(constraint->a, constraint);
	cpBodyRemoveConstraint(constraint->b, constraint);
	constraint->space = NULL;
}
开发者ID:SanLiangSan,项目名称:DDNoOneWrong,代码行数:14,代码来源:cpSpace.c

示例3: cpSpaceAddConstraint

cpConstraint *
cpSpaceAddConstraint(cpSpace *space, cpConstraint *constraint)
{
	cpAssert(!cpArrayContains(space->constraints, constraint), "Cannot add the same constraint more than once.");
//	cpAssertSpaceUnlocked(space); This should be safe as long as its not from a constraint callback.
	
	if(!constraint->a) constraint->a = &space->staticBody;
	if(!constraint->b) constraint->b = &space->staticBody;
	
	cpBodyActivate(constraint->a);
	cpBodyActivate(constraint->b);
	cpArrayPush(space->constraints, constraint);
	
	return constraint;
}
开发者ID:harad,项目名称:Last-Escape,代码行数:15,代码来源:cpSpace.c

示例4: internalBodySetMass

static void internalBodySetMass(cpBody *body, cpFloat mass)
{
    cpBodyActivate(body);
    body->m = mass;
    body->m_inv = 1.0f/mass;
    //cpAssertSaneBody(body);
}
开发者ID:bonlai,项目名称:3kaigame,代码行数:7,代码来源:CCPhysicsBody.cpp

示例5: cpShapeSetElasticity

void
cpShapeSetElasticity(cpShape *shape, cpFloat elasticity)
{
	cpAssertHard(elasticity >= 0.0f, "Elasticity must be positive and non-zero.");
	cpBodyActivate(shape->body);
	shape->e = elasticity;
}
开发者ID:azul3d-legacy,项目名称:native-cp,代码行数:7,代码来源:cpShape.c

示例6: cpBodySetMass

void
cpBodySetMass(cpBody *body, cpFloat mass)
{
	cpBodyActivate(body);
	body->m = mass;
	body->m_inv = 1.0f/mass;
}
开发者ID:bentford,项目名称:ButtonWars,代码行数:7,代码来源:cpBody.c

示例7: cpBodySetMoment

void
cpBodySetMoment(cpBody *body, cpFloat moment)
{
	cpBodyActivate(body);
	body->i = moment;
	body->i_inv = 1.0f/moment;
}
开发者ID:bentford,项目名称:ButtonWars,代码行数:7,代码来源:cpBody.c

示例8: cpBodyApplyForce

void
cpBodyApplyForce(cpBody *body, cpVect force, cpVect r)
{
	cpBodyActivate(body);
	body->f = cpvadd(body->f, force);
	body->t += cpvcross(r, force);
}
开发者ID:bentford,项目名称:ButtonWars,代码行数:7,代码来源:cpBody.c

示例9: cpShapeSetFriction

void
cpShapeSetFriction(cpShape *shape, cpFloat friction)
{
	cpAssertHard(friction >= 0.0f, "Friction must be postive and non-zero.");
	cpBodyActivate(shape->body);
	shape->u = friction;
}
开发者ID:azul3d-legacy,项目名称:native-cp,代码行数:7,代码来源:cpShape.c

示例10: cpBodyResetForces

void
cpBodyResetForces(cpBody *body)
{
	cpBodyActivate(body);
	body->f = cpvzero;
	body->t = 0.0f;
}
开发者ID:jelowang,项目名称:i51,代码行数:7,代码来源:cpBody.cpp

示例11: cpBodySetPos

void
cpBodySetPos(cpBody *body, cpVect pos)
{
	cpBodyActivate(body);
	cpBodyAssertSane(body);
	body->p = pos;
}
开发者ID:bentford,项目名称:ButtonWars,代码行数:7,代码来源:cpBody.c

示例12: cpBodySetAngle

void
cpBodySetAngle(cpBody *body, cpFloat angle)
{
	cpBodyActivate(body);
	cpBodyAssertSane(body);
	setAngle(body, angle);
}
开发者ID:bentford,项目名称:ButtonWars,代码行数:7,代码来源:cpBody.c

示例13: cpShapeSetMass

void
cpShapeSetMass(cpShape *shape, cpFloat mass){
	cpBody *body = shape->body;
	cpBodyActivate(body);
	
	shape->massInfo.m = mass;
	cpBodyAccumulateMassFromShapes(body);
}
开发者ID:6311879,项目名称:LearnCocos2D,代码行数:8,代码来源:cpShape.c

示例14: cpSpaceAddConstraint

cpConstraint *
cpSpaceAddConstraint(cpSpace *space, cpConstraint *constraint)
{
	cpAssertSoft(!constraint->space, "This shape is already added to a space and cannot be added to another.");
	cpAssertSpaceUnlocked(space);
	
	cpBodyActivate(constraint->a);
	cpBodyActivate(constraint->b);
	cpArrayPush(space->constraints, constraint);
	
	// Push onto the heads of the bodies' constraint lists
	cpBody *a = constraint->a, *b = constraint->b;
	constraint->next_a = a->constraintList; a->constraintList = constraint;
	constraint->next_b = b->constraintList; b->constraintList = constraint;
	constraint->space = space;
	
	return constraint;
}
开发者ID:wdmchaft,项目名称:h5_drive,代码行数:18,代码来源:cpSpace.c

示例15: cpBodySleep

void PhysicsBody::setResting(bool rest) const
{
    if (rest && !isResting())
    {
        cpBodySleep(_info->getBody());
    }else if(!rest && isResting())
    {
        cpBodyActivate(_info->getBody());
    }
}
开发者ID:highjin,项目名称:ProjectArthas,代码行数:10,代码来源:CCPhysicsBody.cpp


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