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


C++ Vector4::Y方法代码示例

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


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

示例1: sigP

void DiracAntiSpinor::SetP4(const Vector4<double> &__p4,
			    const double &__mass){

  Matrix <complex<double> > sigP(2,2);
  Matrix <complex<double> > chi(2,1);
  PauliSigma sigma;

  _p4 = __p4;
  _mass = __mass;

  complex<double> norm = sqrt(__p4.E() + __mass);
  complex<double> epm = __p4.E() + __mass;
  sigP = sigma[1]*__p4.X() + sigma[2]*__p4.Y() + sigma[3]*__p4.Z();

  // spin up
  chi(0,0) = 0.;  
  chi(1,0) = 1.;  
  _spinors[1](2,0) = chi(0,0)*norm;
  _spinors[1](3,0) = chi(1,0)*norm;
  _spinors[1](0,0) = ((sigP*chi)(0,0))*norm/epm;
  _spinors[1](1,0) = ((sigP*chi)(1,0))*norm/epm;

  // spin down
  chi(0,0) = 1.;
  chi(1,0) = 0.;
  _spinors[0](2,0) = chi(0,0)*norm;
  _spinors[0](3,0) = chi(1,0)*norm;
  _spinors[0](0,0) = ((sigP*chi)(0,0))*norm/epm;
  _spinors[0](1,0) = ((sigP*chi)(1,0))*norm/epm;
  
  this->_SetProjector();
}
开发者ID:jdalseno,项目名称:qft,代码行数:32,代码来源:DiracAntiSpinor.C

示例2: return

Point4::type Point4::DotProduct(Vector4 const& v) const
{
    return (m_elements[0] * v.X())
           + (m_elements[1] * v.Y())
           + (m_elements[2] * v.Z())
           + (m_elements[3] * v.W());
}
开发者ID:chibiketan,项目名称:Croissant,代码行数:7,代码来源:Point4.cpp

示例3:

	void Shader::SetVector4(std::string name, Vector4 value)
	{
		int uloc = SIG_FindUniform(name);
		if (uloc != -1) {
			glUniform4fARB(uloc, value.X(), value.Y(), value.Z(), value.W());
		} else {
			SIG_LOG("Could not find uniform \"" << name << "\"");
		}
	}
开发者ID:Krypto,项目名称:Sigma-Engine,代码行数:9,代码来源:Shader.cpp

示例4: renderInternal

void LightRenderNode::renderInternal() {
	Quaternion* orientation;
	Vector3 unitVector;
	Vector3 rotated;
	Vector4 vLightPosition;
	Vector4 vLightDirection;
	Vector3* pos;
	
	GLuint lightNum = GL_LIGHT0 + getAndIncLightNumber();
	
	switch(lightType) {
		case LIGHT_DIRECTIONAL:
			orientation = owner->getTransform()->getOrientation();
			unitVector = Vector3(0.0f,0.0f,1.0f);	
			rotated = orientation->Rotate(unitVector);
			
			vLightDirection.X() = -rotated.X();
			vLightDirection.Y() = -rotated.Y();
			vLightDirection.Z() = -rotated.Z();
			vLightDirection.W() = 0.0f;
			
			glEnable(lightNum);
			glLightfv(lightNum, GL_POSITION, (float*)&vLightDirection);
			break;
		case LIGHT_POINT:
			pos = owner->getTransform()->getPosition();
			vLightPosition.X() = pos->X();
			vLightPosition.Y() = pos->Y();
			vLightPosition.Z() = pos->Z();
			vLightPosition.W() = 1.0f;
			
			glEnable(lightNum);
			glLightfv(lightNum, GL_POSITION, (float*)&vLightPosition);
			break;
		case LIGHT_SPOT:
			pos = owner->getTransform()->getPosition();
			orientation = owner->getTransform()->getOrientation();
			unitVector = Vector3(0.0f,0.0f,1.0f);	
			rotated = orientation->Rotate(unitVector);
			
			vLightPosition.X() = pos->X();
			vLightPosition.Y() = pos->Y();
			vLightPosition.Z() = pos->Z();
			vLightPosition.W() = 1.0f;
			
			orientation = owner->getTransform()->getOrientation();
			unitVector = Vector3(0.0f,0.0f,1.0f);	
			rotated = orientation->Rotate(unitVector);
			
			vLightDirection.X() = rotated.X();
			vLightDirection.Y() = rotated.Y();
			vLightDirection.Z() = rotated.Z();
			vLightDirection.W() = 0.0f;
			
			glEnable(lightNum);
			glLightf(lightNum, GL_SPOT_CUTOFF, 45.0);
			glLightfv(lightNum, GL_POSITION, (float*)&vLightPosition);
			glLightfv(lightNum, GL_SPOT_DIRECTION, (float*)&vLightDirection);
			break;
	}
	
	glLightfv(lightNum, GL_AMBIENT, (float*)&ambient);
	glLightfv(lightNum, GL_DIFFUSE, (float*)&diffuse);
	glLightfv(lightNum, GL_SPECULAR, (float*)&specular);
}
开发者ID:rasslingcats,项目名称:calico,代码行数:65,代码来源:LightRenderNode.cpp

示例5: Cos

		Quaternion::Quaternion(Vector4 const& vector, float angle)
			: m_elements { Cos(angle / 2.0f), vector.X() * Sin(angle / 2.0f), vector.Y() * Sin(angle / 2.0f),
			vector.Z() * Sin(angle / 2.0f) }
		{
		}
开发者ID:chibiketan,项目名称:Croissant,代码行数:5,代码来源:Quaternion.cpp


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