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


C++ Anglef::getPitch方法代码示例

本文整理汇总了C++中Anglef::getPitch方法的典型用法代码示例。如果您正苦于以下问题:C++ Anglef::getPitch方法的具体用法?C++ Anglef::getPitch怎么用?C++ Anglef::getPitch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Anglef的用法示例。


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

示例1: Create

void CMagicMissile::Create(const Vec3f & aeSrc, const Anglef & angles)
{
	SetDuration(ulDuration);
	
	eCurPos = eSrc = aeSrc;

	Vec3f e = eSrc;

	int i = 40;
	e.x -= std::sin(glm::radians(angles.getPitch())) * 50 * i;
	e.y += std::sin(glm::radians(MAKEANGLE(angles.getYaw()))) * 50 * i;
	e.z += std::cos(glm::radians(angles.getPitch())) * 50 * i;

	pathways[0].p = eSrc;
	pathways[5].p = e;
	Split(pathways, 0, 5, 50, 0.5f);

	for(i = 0; i < 6; i++) {
		if(pathways[i].p.y >= eSrc.y + 150) {
			pathways[i].p.y = eSrc.y + 150;
		}
	}

	fTrail = 0;

	iLength = 50;
	iBezierPrecision = BEZIERPrecision;
	fOneOnBezierPrecision = 1.0f / (float) iBezierPrecision;
	bExplo = false;
	bMove = true;

	ARX_SOUND_PlaySFX(SND_SPELL_MM_CREATE, &eCurPos);
	ARX_SOUND_PlaySFX(SND_SPELL_MM_LAUNCH, &eCurPos);
	snd_loop = ARX_SOUND_PlaySFX(SND_SPELL_MM_LOOP, &eCurPos, 1.0F, ARX_SOUND_PLAY_LOOPED);
}
开发者ID:byouloh,项目名称:ArxLibertatis,代码行数:35,代码来源:Spells01.cpp

示例2: ARXDRAW_DrawEyeBall

void ARXDRAW_DrawEyeBall() {
	if(eyeball.exist == 0 || !eyeballobj)
		return;

	float d;

	if(eyeball.exist < 0) {
		d = (float)(-eyeball.exist)*( 1.0f / 100 );
		eyeball.exist++;
	} else if(eyeball.exist > 2) {
		d = (float)(eyeball.exist)*( 1.0f / 100 );
	}
	else
		return;

	Anglef angle = eyeball.angle;
	angle.setPitch(MAKEANGLE(180.f - angle.getPitch()));

	Vec3f pos = eyeball.pos;
	pos.y += eyeball.floating;

	Vec3f scale = Vec3f(d);
	Color3f rgb = Color3f::gray(d);
	
	RenderMaterial mat;
	mat.setDepthTest(true);
	mat.setBlendType(RenderMaterial::Additive);
	
	Draw3DObject(eyeballobj, angle, pos, scale, rgb, mat);
}
开发者ID:Drakesinger,项目名称:ArxLibertatis,代码行数:30,代码来源:FlyingEye.cpp

示例3: Create

void CMagicMissile::Create(const Vec3f & startPos, const Anglef & angles)
{
	SetDuration(ulDuration);
	
	eCurPos = startPos;
	
	short i = 40.f;
	Vec3f endPos = startPos;
	endPos += angleToVectorXZ(angles.getPitch()) * (50.f * i);
	endPos.y += std::sin(glm::radians(MAKEANGLE(angles.getYaw()))) * (50.f * i);
	
	pathways[0] = startPos;
	pathways[5] = endPos;
	Split(pathways, 0, 5, 50, 0.5f);

	for(i = 0; i < 6; i++) {
		if(pathways[i].y >= startPos.y + 150) {
			pathways[i].y = startPos.y + 150;
		}
	}

	fTrail = 0;

	iLength = 50;
	iBezierPrecision = BEZIERPrecision;
	bExplo = false;
	bMove = true;

	ARX_SOUND_PlaySFX(SND_SPELL_MM_CREATE, &eCurPos);
	ARX_SOUND_PlaySFX(SND_SPELL_MM_LAUNCH, &eCurPos);
	snd_loop = ARX_SOUND_PlaySFX(SND_SPELL_MM_LOOP, &eCurPos, 1.0F, ARX_SOUND_PLAY_LOOPED);
}
开发者ID:nemyax,项目名称:ArxLibertatis,代码行数:32,代码来源:MagicMissile.cpp

示例4: angleToQuatForExtraRotation

glm::quat angleToQuatForExtraRotation(const Anglef & angle) {
	Anglef vt1;
	vt1.setYaw(angle.getRoll());
	vt1.setPitch(angle.getPitch());
	vt1.setRoll(angle.getYaw());
	
	return QuatFromAngles(vt1);
}
开发者ID:Gladius1,项目名称:ArxLibertatis,代码行数:8,代码来源:Math.cpp

示例5: toRotationMatrix

glm::mat4 toRotationMatrix(const Anglef & angle) {
	float yaw = glm::radians(angle.getYaw());
	float pitch = glm::radians(angle.getPitch());
	float roll = glm::radians(angle.getRoll());
	glm::mat4 rotateX = glm::eulerAngleX(yaw);
	glm::mat4 rotateY = glm::eulerAngleY(pitch);
	glm::mat4 rotateZ = glm::eulerAngleZ(-roll);
	return rotateZ * rotateX * rotateY;
}
开发者ID:Gladius1,项目名称:ArxLibertatis,代码行数:9,代码来源:Math.cpp

示例6: angleToVector

Vec3f angleToVector(const Anglef & angle) {
	Vec3f cam_vector = angleToVectorXZ(angle.getPitch());
	
	float yaw = glm::radians(angle.getYaw());
	cam_vector.x *= std::cos(yaw);
	cam_vector.y = std::sin(yaw);
	cam_vector.z *= std::cos(yaw);
	
	return cam_vector;
}
开发者ID:Gladius1,项目名称:ArxLibertatis,代码行数:10,代码来源:Math.cpp

示例7: angleToQuatForArrow

glm::quat angleToQuatForArrow(const Anglef & angle) {
	float aa = angle.getYaw();
	float ab = 90 - angle.getPitch();
	
	Vec3f front(0,0,1);
	Vec3f up(0,-1,0);
	
	front = VRotateZ(front, aa);
	front = VRotateY(front, ab);
	up = VRotateZ(up, aa);
	up = VRotateY(up, ab);
	
	glm::mat4x4 tmat;
	MatrixSetByVectors(tmat, front, up);
	return glm::toQuat(tmat);
}
开发者ID:Gladius1,项目名称:ArxLibertatis,代码行数:16,代码来源:Math.cpp

示例8: QuatFromAngles

//*************************************************************************************
// Converts euler angles to a unit quaternion.
//*************************************************************************************
glm::quat QuatFromAngles(const Anglef & angle) {
	float A, B;
	A = glm::radians(angle.getYaw()) * ( 1.0f / 2 );
	B = glm::radians(angle.getPitch()) * ( 1.0f / 2 );

	float fSinYaw   = glm::sin(A);
	float fCosYaw   = glm::cos(A);
	float fSinPitch = glm::sin(B);
	float fCosPitch = glm::cos(B);
	A = glm::radians(angle.getRoll()) * ( 1.0f / 2 );
	float fSinRoll  = glm::sin(A);
	float fCosRoll  = glm::cos(A);
	A = fCosRoll * fCosPitch;
	B = fSinRoll * fSinPitch;
	
	glm::quat q;
	q.x = fSinRoll * fCosPitch * fCosYaw - fCosRoll * fSinPitch * fSinYaw;
	q.y = fCosRoll * fSinPitch * fCosYaw + fSinRoll * fCosPitch * fSinYaw;
	q.z = A * fSinYaw - B * fCosYaw;
	q.w = A * fCosYaw + B * fSinYaw;
	return q;
}
开发者ID:Gladius1,项目名称:ArxLibertatis,代码行数:25,代码来源:Math.cpp

示例9: Manage3DCursor

bool Manage3DCursor(Entity * io, bool simulate) {
	
	arx_assert(io);
	
	if(BLOCK_PLAYER_CONTROLS)
		return false;

	float ag = player.angle.getYaw();

	if(ag > 180)
		ag = ag - 360;

	float drop_miny = (float)(g_size.center().y) - g_size.center().y * (ag * (1.f/70));

	if(DANAEMouse.y < drop_miny)
		return false;
	
	Anglef temp = Anglef::ZERO;

	if(io->ioflags & IO_INVERTED) {
		temp.setYaw(180.f);
		temp.setPitch(-MAKEANGLE(270.f - io->angle.getPitch() - (player.angle.getPitch() - STARTED_ANGLE)));
	} else {
		temp.setPitch(MAKEANGLE(270.f - io->angle.getPitch() - (player.angle.getPitch() - STARTED_ANGLE)));
	}
	
	EERIE_3D_BBOX bbox;
	for(size_t i = 0; i < io->obj->vertexlist.size(); i++) {
		bbox.add(io->obj->vertexlist[i].v);
	}
	
	Vec3f mvectx = angleToVectorXZ(player.angle.getPitch() - 90.f);
	
	Vec2f mod = Vec2f(Vec2i(DANAEMouse) - g_size.center()) / Vec2f(g_size.center()) * Vec2f(160.f, 220.f);
	mvectx *= mod.x;
	Vec3f mvecty(0, mod.y, 0);

	Vec3f orgn = player.pos;
	orgn += angleToVector(player.angle) * 50.f;
	orgn += mvectx;
	orgn.y += mvecty.y;

	Vec3f dest = player.pos;
	dest += angleToVector(player.angle) * 10000.f;
	dest += mvectx;
	dest.y += mvecty.y * 5.f;
	
	Vec3f pos = orgn;

	Vec3f movev = glm::normalize(dest - orgn);

	float lastanything = 0.f;
	float height = -(bbox.max.y - bbox.min.y);

	if(height > -30.f)
		height = -30.f;
	
	Vec3f objcenter = bbox.min + (bbox.max - bbox.min) * Vec3f(0.5f);
	
	Vec3f collidpos = Vec3f_ZERO;
	bool collidpos_ok = false;
	
	{
	float maxdist = 0.f;
	
	for(size_t i = 0; i < io->obj->vertexlist.size(); i++) {
		const EERIE_VERTEX & vert = io->obj->vertexlist[i];
		
		float dist = glm::distance(Vec2f(objcenter.x, objcenter.z), Vec2f(vert.v.x, vert.v.z)) - 4.f;
		maxdist = std::max(maxdist, dist);
	}

	if(io->obj->pbox) {
		Vec2f tmpVert(io->obj->pbox->vert[0].initpos.x, io->obj->pbox->vert[0].initpos.z);
		
		for(int i = 1; i < io->obj->pbox->nb_physvert; i++) {
			const PHYSVERT & physVert = io->obj->pbox->vert[i];
			
			float dist = glm::distance(tmpVert, Vec2f(physVert.initpos.x, physVert.initpos.z)) + 14.f;
			maxdist = std::max(maxdist, dist);
		}
	}
	
	Cylinder cyl2;
	const float inc = 10.f;
	long iterating = 40;

	cyl2.height = std::min(-30.f, height);
	cyl2.radius = glm::clamp(maxdist, 20.f, 150.f);
	
	while(iterating > 0) {
		cyl2.origin = pos + movev * inc + Vec3f(0.f, bbox.max.y, 0.f);

		float anything = CheckAnythingInCylinder(cyl2, io, CFLAG_JUST_TEST | CFLAG_COLLIDE_NOCOL | CFLAG_NO_NPC_COLLIDE);

		if(anything < 0.f) {
			if(iterating == 40) {
				CANNOT_PUT_IT_HERE = 1;
				// TODO is this correct ?
				return true;
//.........这里部分代码省略.........
开发者ID:Drakesinger,项目名称:ArxLibertatis,代码行数:101,代码来源:Cursor.cpp

示例10: add

	void add(std::string key, const Anglef value) {
		m_maxKeyLen = std::max(m_maxKeyLen, key.length());
		std::string valueStr = boost::str(boost::format("%4.2f %4.2f %4.2f") % value.getYaw() % value.getPitch() % value.getRoll());
		m_elements.push_back(std::pair<std::string, std::string>(key, valueStr));
	}
开发者ID:Gladius1,项目名称:ArxLibertatis,代码行数:5,代码来源:DebugHud.cpp

示例11: Set_Angle

void CBless::Set_Angle(const Anglef & angle)
{
	m_yaw = angle.getPitch();
}
开发者ID:HerculesCE,项目名称:ArxLibertatis,代码行数:4,代码来源:Spells04.cpp


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