您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ DegreesToRadians函数代码示例

51自学网 2021-06-01 20:26:19
  C++
这篇教程C++ DegreesToRadians函数代码示例写得很实用,希望能帮到您。

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

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

示例1: DirectInput

bool DX10_Camera_FirstPerson::Initialise(DX10_Renderer* _pRenderer, HINSTANCE _hInstance, HWND _hWnd){	m_pRenderer = _pRenderer;	m_pDirectInput = new DirectInput();	VALIDATE(m_pDirectInput->Initialise(_hInstance, _hWnd));	m_position = D3DXVECTOR3(0.0f, 25.0f, -50.0f);	m_target = D3DXVECTOR3(0.0f, 0.0f, 0.0f);	m_up = D3DXVECTOR3(0.0f, 1.0f, 0.0f);	m_forward = D3DXVECTOR3(0.0f, 0.0f, 1.0f);	m_right = D3DXVECTOR3(1.0f, 0.0f, 0.0f);	m_defaultForward = D3DXVECTOR3(0.0f, 0.0f, 1.0f);	m_defaultRight = D3DXVECTOR3(1.0f, 0.0f, 0.0f);	m_moveStrafe = 0.0f;	m_moveForwards = 0.0f;	m_moveFly = 0.0f;	m_yaw = 0.0f;	m_pitch = DegreesToRadians(30.0f);	m_yawChange = 0.0f;	m_pitchChange = 0.0f;	m_speed = 20.0f;	m_rotSpeed = DegreesToRadians(90.0f);	m_maxRotation = DegreesToRadians(89.0f);	m_minRotation = DegreesToRadians(-89.0f);	Process(0.016f);	return true;}
开发者ID:Moorecj007,项目名称:DX10-Framework,代码行数:32,


示例2: getToken

Transform* SceneParser::parseTransform() {	char token[MAX_PARSER_TOKEN_LENGTH];	Matrix matrix; matrix.SetToIdentity();	Object3D *object = NULL;	getToken(token); assert(!strcmp(token, "{"));	// read in transformations: 	// apply to the LEFT side of the current matrix (so the first	// transform in the list is the last applied to the object)	getToken(token);	while (1) {		if (!strcmp(token, "Scale")) {			matrix *= Matrix::MakeScale(readVec3f());		}		else if (!strcmp(token, "UniformScale")) {			float s = readFloat();			matrix *= Matrix::MakeScale(Vec3f(s, s, s));		}		else if (!strcmp(token, "Translate")) {			matrix *= Matrix::MakeTranslation(readVec3f());		}		else if (!strcmp(token, "XRotate")) {			matrix *= Matrix::MakeXRotation(DegreesToRadians(readFloat()));		}		else if (!strcmp(token, "YRotate")) {			matrix *= Matrix::MakeYRotation(DegreesToRadians(readFloat()));		}		else if (!strcmp(token, "ZRotate")) {			matrix *= Matrix::MakeZRotation(DegreesToRadians(readFloat()));		}		else if (!strcmp(token, "Rotate")) {			getToken(token); assert(!strcmp(token, "{"));			Vec3f axis = readVec3f();			float degrees = readFloat();			matrix *= Matrix::MakeAxisRotation(axis, DegreesToRadians(degrees));			getToken(token); assert(!strcmp(token, "}"));		}		else if (!strcmp(token, "Matrix")) {			Matrix matrix2; matrix2.SetToIdentity();			getToken(token); assert(!strcmp(token, "{"));			for (int j = 0; j < 4; j++) {				for (int i = 0; i < 4; i++) {					float v = readFloat();					matrix2.Set(i, j, v);				}			}			getToken(token); assert(!strcmp(token, "}"));			matrix = matrix2 * matrix;		}		else {			// otherwise this must be an object,			// and there are no more transformations			object = parseObject(token);			break;		}		getToken(token);	}	assert(object != NULL);	getToken(token); assert(!strcmp(token, "}"));	return new Transform(matrix, object);}
开发者ID:ChanganVR,项目名称:ray-tracer,代码行数:60,


示例3:

void Magick::Options::transformRotation(double angle_){  AffineMatrix    affine,    current=_drawInfo->affine;  affine.sx=1.0;  affine.rx=0.0;  affine.ry=0.0;  affine.sy=1.0;  affine.tx=0.0;  affine.ty=0.0;  affine.sx=cos(DegreesToRadians(fmod(angle_,360.0)));  affine.rx=(-sin(DegreesToRadians(fmod(angle_,360.0))));  affine.ry=sin(DegreesToRadians(fmod(angle_,360.0)));  affine.sy=cos(DegreesToRadians(fmod(angle_,360.0)));  _drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx;  _drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx;  _drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy;  _drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy;  _drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx;  _drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty;}
开发者ID:riingo,项目名称:ImageMagick,代码行数:25,


示例4: addPortalGun

    void WeaponHUD::addPortalGun() {        ref_ptr<Node> portalGun = osgDB::readNodeFile("../BlenderFiles/exports/Portalgun.ive");	/*	 * rotating and translating the portal gun to the lower	 * right of the screen	 */        ref_ptr<MatrixTransform> portalGunTransform = new MatrixTransform;        portalGunTransform->setMatrix(            Matrix::rotate(osg::DegreesToRadians(0.0), X_AXIS)            *Matrix::rotate(DegreesToRadians(0.0), Y_AXIS)            *Matrix::rotate(DegreesToRadians(90.0), Z_AXIS)            *Matrix::translate(osg::Vec3(0.7f, 1.5f, -1.3f))            );        portalGunTransform->addChild(portalGun);        /*	 * Set proper lighting and reflection	 */	brtr::ModifyMaterialVisitor mmv;        mmv.setAmbient(Vec4(1.3, 1.3, 1.3, 1)).setShininess(42).setSpecular(Vec4(0.4, 0.4, 0.4, 1));        portalGun->accept(mmv);        _switcher->setAllChildrenOff();        _switcher->addChild(portalGunTransform, true);            }
开发者ID:goost,项目名称:BrainTrain,代码行数:25,


示例5: Draw_rotation_eq

/*    Method:     Magick::Draw#rotation=degrees    Purpose:    set rotation attribute value    Notes:      Taken from Magick++'s Magick::Image::annotate method                Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002*/VALUEDraw_rotation_eq(VALUE self, VALUE deg){    Draw *draw;    double degrees;    AffineMatrix affine, current;    rb_check_frozen(self);    Data_Get_Struct(self, Draw, draw);    degrees = NUM2DBL(deg);    if (fabs(degrees) > DBL_EPSILON)    {        affine.sx=1.0;        affine.rx=0.0;        affine.ry=0.0;        affine.sy=1.0;        affine.tx=0.0;        affine.ty=0.0;        current = draw->info->affine;        affine.sx=cos(DegreesToRadians(fmod(degrees,360.0)));        affine.rx=sin(DegreesToRadians(fmod(degrees,360.0)));        affine.ry=(-sin(DegreesToRadians(fmod(degrees,360.0))));        affine.sy=cos(DegreesToRadians(fmod(degrees,360.0)));        draw->info->affine.sx=current.sx*affine.sx+current.ry*affine.rx;        draw->info->affine.rx=current.rx*affine.sx+current.sy*affine.rx;        draw->info->affine.ry=current.sx*affine.ry+current.ry*affine.sy;        draw->info->affine.sy=current.rx*affine.ry+current.sy*affine.sy;        draw->info->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx;    }    return self;}
开发者ID:akankshita,项目名称:HealtyPrice,代码行数:41,


示例6: VCPoint2D

VCPoint2D* ViceGeom::PlacePointFrom(VCPoint2D* point, float angle, float distance) {	VCPoint2D* result = new VCPoint2D();	result->x = point->x + sin(DegreesToRadians(angle)) * distance;	result->y = point->y + cos(DegreesToRadians(angle)) * distance;	return result;}
开发者ID:Serabass,项目名称:vc-magic,代码行数:8,


示例7: getToken

Transform *SceneParser::parseTransform() {    char token[MAX_PARSER_TOKEN_LENGTH];    Matrix4f matrix = Matrix4f::identity();    Object3D *object = NULL;    getToken(token); assert(!strcmp(token, "{"));    // read in transformations:     // apply to the LEFT side of the current matrix (so the first    // transform in the list is the last applied to the object)    getToken(token);    while (true) {        if (!strcmp(token,"Scale")) {            Vector3f s = readVector3f();            matrix = matrix * Matrix4f::scaling( s[0], s[1], s[2] );        } else if (!strcmp(token,"UniformScale")) {            float s = readFloat();            matrix = matrix * Matrix4f::uniformScaling( s );        } else if (!strcmp(token,"Translate")) {            matrix = matrix * Matrix4f::translation( readVector3f() );        } else if (!strcmp(token,"XRotate")) {            matrix = matrix * Matrix4f::rotateX((float) DegreesToRadians(readFloat()));        } else if (!strcmp(token,"YRotate")) {            matrix = matrix * Matrix4f::rotateY((float) DegreesToRadians(readFloat()));        } else if (!strcmp(token,"ZRotate")) {            matrix = matrix * Matrix4f::rotateZ((float) DegreesToRadians(readFloat()));        } else if (!strcmp(token,"Rotate")) {            getToken(token); assert(!strcmp(token, "{"));            Vector3f axis = readVector3f();            float degrees = readFloat();            float radians = (float) DegreesToRadians(degrees);            matrix = matrix * Matrix4f::rotation(axis,radians);            getToken(token); assert(!strcmp(token, "}"));        } else if (!strcmp(token,"Matrix4f")) {            Matrix4f matrix2 = Matrix4f::identity();            getToken(token); assert(!strcmp(token, "{"));            for (int j = 0; j < 4; j++) {                for (int i = 0; i < 4; i++) {                    float v = readFloat();                    matrix2( i, j ) = v;                 }             }            getToken(token); assert(!strcmp(token, "}"));            matrix = matrix2 * matrix;        } else {            // otherwise this must be an object,            // and there are no more transformations            object = parseObject(token);            break;        }        getToken(token);    }    assert(object != NULL);    getToken(token); assert(!strcmp(token, "}"));    return new Transform(matrix, object);}
开发者ID:sskirlo,项目名称:Computer-Graphics-,代码行数:58,


示例8: VRotate2D

Vector	VRotate2D( float angle, Vector u){	float	x,y;	x = u.x * cos(DegreesToRadians(-angle)) + u.y * sin(DegreesToRadians(-angle));	y = -u.x * sin(DegreesToRadians(-angle)) + u.y * cos(DegreesToRadians(-angle));	return Vector( x, y, 0);}
开发者ID:KWJYP,项目名称:M.J_Physical_GameStudio_Engine,代码行数:9,


示例9: sinf

void CShapeRenderer::DrawSphere(const CVec3& pos, float fRadius, float fElliptical, CColor color, uint32_t uGridCnt, bool bWireFrame) const{    if (BEATS_FLOAT_GREATER(fRadius, 0.0F))    {        const uint32_t uVertexCnt = uGridCnt + 1;        std::vector<CVertexPC> vertices;        std::vector<unsigned short> indices;        // Generate vertex.        for (uint32_t y = 0; y < uVertexCnt; y++)        {            for (uint32_t x = 0; x < uVertexCnt; x++)            {                CVertexPC vertex;                vertex.color = color;                vertex.position.X() = sinf(DegreesToRadians((float)y / (float)(uVertexCnt - 1) * 180.0F)) *                    cosf(DegreesToRadians((float)x / (float)(uVertexCnt - 1) * 360.0F)) *                    fRadius;                vertex.position.Y() =                    cosf(DegreesToRadians((float)y / (float)(uVertexCnt - 1) * 180.0F)) *                    fRadius *                    fElliptical;                vertex.position.Z() =                    sinf(DegreesToRadians((float)y / (float)(uVertexCnt - 1) * 180.0F)) *                    sinf(DegreesToRadians((float)x / (float)(uVertexCnt - 1) * 360.0F)) *                    fRadius;                vertex.position += pos;                vertices.push_back(vertex);            }        }        // Generate index.        for (uint32_t z = 0; z < uGridCnt; z++)        {            for (uint32_t x = 0; x < uGridCnt; x++)            {                indices.push_back((unsigned short)(z * uVertexCnt + x));                indices.push_back((unsigned short)((z + 1) * uVertexCnt + x + 1));                indices.push_back((unsigned short)((z + 1) * uVertexCnt + x));                indices.push_back((unsigned short)(z * uVertexCnt + x));                indices.push_back((unsigned short)(z * uVertexCnt + x + 1));                indices.push_back((unsigned short)((z + 1) * uVertexCnt + x + 1));            }        }        if (bWireFrame)        {            CRenderManager::GetInstance()->RenderLines(vertices, indices, 1.0f, true);        }        else        {            CRenderManager::GetInstance()->RenderTriangle(vertices, indices, true);        }    }}
开发者ID:BeyondEngine,项目名称:BeyondEngine,代码行数:56,


示例10: GetDistance

// calculates the distance between two coordinates in nautical milesstatic double GetDistance(double latiudeA, double longitudeA, double latiudeB, double longitudeB){    double dLatitude = latiudeB - latiudeA;    double dLongitude = longitudeB - longitudeA;    double a = pow(sin(DegreesToRadians(dLatitude / 2.0)), 2) + cos(DegreesToRadians(latiudeA)) * cos(DegreesToRadians(latiudeB)) * pow(sin(DegreesToRadians(dLongitude / 2.0)), 2);    double c = 2.0 * atan2(sqrt(a), sqrt(1.0 - a));    return c * RADIUS_EARTH;}
开发者ID:bwRavencl,项目名称:X-fr24,代码行数:11,


示例11: cos

	void Lights::SetLightSpotLight(int index, float radius, const Vector3Df& dir, float outAngle, float inAngle)	{		if(IsIndexValid(index))		{			m_radius[index] = radius;			m_dir[index] = dir;			m_angleInnerCone[index] = cos(DegreesToRadians(inAngle));			m_angleOuterCone[index] = cos(DegreesToRadians(outAngle));		}	}
开发者ID:TrevinLiberty,项目名称:CaptainLucha,代码行数:10,


示例12: tEulerCamera

tCamera::tCamera():    tEulerCamera(){    m_MinElevation = DegreesToRadians(1);    m_MaxElevation = DegreesToRadians(90);    m_MinX = -19970325L;    m_MaxX = 19970325L;    m_MinY = -20616952L;    m_MaxY = 17947623L;}
开发者ID:dulton,项目名称:53_hero,代码行数:11,


示例13: sin

double Elbow::GetCurrentArbFeedForward(void) {	double	wristEffectiveAngle;	double	wristArbFF;	double	curArbFeedForward;	// Wrist adjustment for effect on Elbow	wristEffectiveAngle = Robot::wrist->GetCurrentDegrees() + m_curDegrees - 180.0;	wristArbFF = sin(DegreesToRadians(wristEffectiveAngle)) * m_wristArbFF;	curArbFeedForward = sin(DegreesToRadians(m_curDegrees)) * (m_arbFeedForward + wristArbFF);	return curArbFeedForward;}
开发者ID:usfirst-frc-2135,项目名称:software,代码行数:12,


示例14:

void tSonar3D::ResetCameraToHome(){    m_CameraDistanceMeters = cDefaultCameraDistanceMeters;    m_CameraRelativeAngleDegrees = 0;    m_TrackBallInteractor        .SetTarget(m_Target)        .SetAzimuth(DegreesToRadians(HeadingToCartesianAngle(m_SceneSettings.vesselHeading)))        .SetElevation(DegreesToRadians(cDefaultElevationDegrees))        .SetDistance(m_CameraDistanceMeters)                .UpdateCamera();}
开发者ID:dulton,项目名称:53_hero,代码行数:12,


示例15: DegreesToRadians

float MathHelper::Sin(float angle, bool radians){    if ( !radians )        angle = DegreesToRadians( angle );    return float( sin( angle ) );}
开发者ID:Wolf-Code,项目名称:CPP-Practice,代码行数:7,


示例16: tan

// Method using yPosdouble KauaibotsTarget::GetDistanceToGoalFeet(){	double dDistanceInches = ( (cTargetCenterHeightInches - cCameraLensHeightInches) /		 tan( DegreesToRadians ( fabs ( GetRobotVerticalAngle())))) / 12;		return dDistanceInches;}
开发者ID:IAmAGitNewbie,项目名称:kauaibotsfirst2010,代码行数:8,


示例17: DrawCube

void DrawCube(void){    float CubeAngle;    clock_t Now = clock();    if (LastTime == 0)        LastTime = Now;    CubeRotation += 45.0f * ((float)(Now - LastTime) / CLOCKS_PER_SEC);    CubeAngle = DegreesToRadians(CubeRotation);    LastTime = Now;    ModelMatrix = IDENTITY_MATRIX;    RotateAboutY(&ModelMatrix, CubeAngle);    RotateAboutX(&ModelMatrix, CubeAngle);    glUseProgram(ShaderIds[0]);    ExitOnGLError("ERROR: Could not use the shader program");    glUniformMatrix4fv(ModelMatrixUniformLocation, 1, GL_FALSE, ModelMatrix.m);    glUniformMatrix4fv(ViewMatrixUniformLocation, 1, GL_FALSE, ViewMatrix.m);    ExitOnGLError("ERROR: Could not set the shader uniforms");    glBindVertexArray(BufferIds[0]);    ExitOnGLError("ERROR: Could not bind the VAO for drawing purposes");    glDrawElements(GL_TRIANGLES, 36, GL_UNSIGNED_INT, (GLvoid*)0);    ExitOnGLError("ERROR: Could not draw the cube");    glBindVertexArray(0);    glUseProgram(0);}
开发者ID:DanmerZ,项目名称:openglbook-samples,代码行数:32,


示例18: BEATS_CLIP_VALUE

void CShapeModule::InitParticleForCone(CVec3& localPos, CVec3& direction, float fParticleScale) const{    CVec3 finalPos, finalDirection;    float fClipAngle = m_fAngle;    BEATS_CLIP_VALUE(fClipAngle, 0, 89.99f);    float fRadius = m_fRadius * fParticleScale;    float fConeLength = m_fConeLength * fParticleScale;    float fTopRadius = fRadius + fConeLength * tanf(DegreesToRadians(fClipAngle));    CVec3 randomDirection(PARTICLE_RAND_RANGE(-1, 1), PARTICLE_RAND_RANGE(-1, 1), 0);    randomDirection.Normalize();    float fRadiusOnBase = m_bEmitFromShell ? fRadius : PARTICLE_RAND_RANGE(0, fRadius);    finalPos = randomDirection * fRadiusOnBase;    BEATS_ASSERT(!BEATS_FLOAT_EQUAL(fRadius, 0));    fTopRadius *= (fRadiusOnBase / fRadius);    CVec3 topPos = (m_bRandomDirection ? GetRandomDirection() : randomDirection) * fTopRadius;    topPos.Z() = fConeLength;    finalDirection = topPos - finalPos;    if (!m_bEmitFromBaseOrVolume)    {        finalPos += (finalDirection * PARTICLE_RAND_RANGE(0, 1));        if (m_bRandomDirection)        {            finalDirection = GetRandomDirection();        }    }    finalDirection.Normalize();    localPos = finalPos;    direction = finalDirection;}
开发者ID:BeyondEngine,项目名称:BeyondEngine,代码行数:30,


示例19: CreateProjectionMatrix

mat4x4 CreateProjectionMatrix( float fovy,                               float aspect_ratio,                               float near_plane,                               float far_plane ){    mat4x4 out = { { 0 } };    const float y_scale = Cotangent(DegreesToRadians(fovy / 2));    const float x_scale = y_scale / aspect_ratio;    const float frustum_length = far_plane - near_plane;    out.m[0] = x_scale;    out.m[5] = y_scale;    out.m[10] = -((far_plane + near_plane) / frustum_length);    out.m[11] = -1;    out.m[14] = -((2 * near_plane * far_plane) / frustum_length);    return out;}
开发者ID:mlaz,项目名称:CGraphics2014,代码行数:28,


示例20: GetPlayAreaPlaneAt

void CPlayAreaManager::GetPlayAreaPlaneAt(CVector vPos,CVector *pPlayAreaMins,CVector *pPlayAreaMaxs){	if(m_CameraWrapper.m_piCamera==NULL){return;}	    double dCameraDistance=(m_vCameraRouteStart.c[1]+m_dCameraDistanceFromPlayer)-vPos.c[1];    double dViewAngle=m_CameraWrapper.m_piCamera->GetViewAngle();    double dAspectRatio=m_CameraWrapper.m_piCamera->GetAspectRatio();    CVector vOffset;	vOffset.c[0]=dCameraDistance*tan(DegreesToRadians(dViewAngle*0.5));	vOffset.c[2]=dCameraDistance*tan(DegreesToRadians((dViewAngle*0.5)))*dAspectRatio;    *pPlayAreaMins=vPos;    *pPlayAreaMaxs=vPos;	pPlayAreaMins->c[0]-=vOffset.c[0];	pPlayAreaMaxs->c[0]+=vOffset.c[0];	pPlayAreaMins->c[2]-=vOffset.c[2];	pPlayAreaMaxs->c[2]+=vOffset.c[2];}
开发者ID:theclai,项目名称:friking-shark,代码行数:17,


示例21: tan

// code based on examples found at http://www.songho.ca/opengl/gl_matrix.html//---------------------------------------------------------------------------void Matrix4::SetPerspective( const float fovy, const float aspect, const float zNear, const float zFar ){	float tangent = tan( DegreesToRadians( fovy / 2.f ) );	float height = zNear * tangent;	float width = height * aspect;	SetFrustum( -width, width, -height, height, zNear, zFar );}
开发者ID:slajar,项目名称:BeatDetection,代码行数:10,


示例22: Matrix3D

void XWing::ReadyForGame(){	matrix = Matrix3D();	matrix = rotate(DegreesToRadians(180));	scalar = 0.5;	position = Vector3D(800, 450);	rotation = 0;	hasAstromechDroid = true;}
开发者ID:JohnR31415,项目名称:Star_Wars_Asteroid_game,代码行数:9,


示例23: DegreesToRadians

	void MatrixStack::Perspective(float fov, float aspect, float zNear, float zFar)	{        const float FOVRadians = DegreesToRadians(fov * 0.5f);		float maxY = zNear * tanf(FOVRadians);		float maxX = maxY * aspect;		Frustum(-maxX, maxX, -maxY, maxY, zNear, zFar);        m_frustum.UpdateData(fov, aspect, zNear, zFar);        m_frustum.UpdateFrustum(Vector3Df(), Vector3Df(0.0f, 0.0f, -1.0f));	}
开发者ID:TrevinLiberty,项目名称:CaptainLucha,代码行数:10,


示例24: Step

	void Step(float angle)	{		float anglerad=DegreesToRadians(angle);		glLoadIdentity();		glTranslatef(0, -4, 0);		glRotatef(1, 0,0,angle-20);		glTranslatef(0, 4, 0);		glRotatef(1, 0,0,-(angle-20));		}
开发者ID:siliconbrain,项目名称:cghw2010fall,代码行数:10,


示例25: sin

double Wrist::GetCurrentArbFeedForward(void) {	double	wristEffectiveAngle;	double	curArbFeedForward;	// Elbow adjustment for effect on Wrist	wristEffectiveAngle = Robot::elbow->GetCurrentDegrees() + m_curDegrees - 180.0;	curArbFeedForward = sin(DegreesToRadians(wristEffectiveAngle)) * m_arbFeedForward;	return curArbFeedForward;}
开发者ID:usfirst-frc-2135,项目名称:software,代码行数:10,


示例26: SetInitialVelocity

void CLiveBonus::SetInitialVelocity(){	if(m_pType->m_PlayAreaManager.m_piPlayAreaManager==NULL){return;}		CMatrix m;	double dInitialAngle=45.0-drand()*90.0;	m_dCurrentAngularVelocity=dInitialAngle>0?m_pType->m_dAngularVelocity:0-m_pType->m_dAngularVelocity;	m.R(AxisPosY,DegreesToRadians(dInitialAngle));	m_vCurrentForwardDirection=AxisPosX;	m_vCurrentForwardDirection*=m;	}
开发者ID:theclai,项目名称:friking-shark,代码行数:11,


示例27: Remove

void CLiveBonus::ProcessFrame(unsigned int dwCurrentTime,double dTimeFraction){	CEntityBase::ProcessFrame(dwCurrentTime,dTimeFraction);	if(m_pType->m_PlayAreaManager.m_piPlayAreaManager==NULL){return;}		CVector vMins,vMaxs;	m_pType->m_PlayAreaManager.m_piPlayAreaManager->GetCurrentVisibleArea(&vMins,&vMaxs);		if(m_PhysicInfo.vPosition.c[0]+m_dRadius<vMins.c[0])	{		Remove();		return;	}		if(m_PhysicInfo.vPosition.c[2]-m_dRadius<vMins.c[2] && m_vCurrentForwardDirection.c[2]<0)	{		CMatrix m;		double dInitialAngle=drand()*(-25.0)-20.0;		m.R(AxisPosY,DegreesToRadians(dInitialAngle));				m_dCurrentAngularVelocity=0-m_pType->m_dAngularVelocity;		m_vCurrentForwardDirection=AxisPosX;		m_vCurrentForwardDirection*=m;	}	if(m_PhysicInfo.vPosition.c[2]+m_dRadius>vMaxs.c[2] && m_vCurrentForwardDirection.c[2]>0)	{		CMatrix m;		double dInitialAngle=drand()*25.0+20.0;		m.R(AxisPosY,DegreesToRadians(dInitialAngle));				m_dCurrentAngularVelocity=m_pType->m_dAngularVelocity;		m_vCurrentForwardDirection=AxisPosX;		m_vCurrentForwardDirection*=m;	}		CMatrix m;	m.R(AxisPosY,DegreesToRadians(m_dCurrentAngularVelocity*dTimeFraction));	m_vCurrentForwardDirection*=m;	m_vCurrentForwardDirection.N();		double dCameraFollow=(m_pType->m_PlayAreaManager.m_piPlayAreaManager->GetCameraSpeed()-m_pType->m_dExitVelocity);	m_PhysicInfo.vVelocity=m_vCurrentForwardDirection*m_pType->m_dForwardVelocity+AxisPosX*dCameraFollow;}
开发者ID:theclai,项目名称:friking-shark,代码行数:41,


示例28: SetProjectionMatrix

void ViewContext::SetProjectionMatrix(const Matrix4x4 &m){	if (!IgnoringScreenRotation() && m_screenOrientation != SCREEN_ANGLE_0)	{		// apply a rotation immediately _after_ the projection matrix transform		float angle = (float)m_screenOrientation;		Matrix4x4 adjusted = Matrix4x4::CreateRotationZ(-DegreesToRadians(angle)) * m;		m_projectionStack.top = adjusted;	}	else		m_projectionStack.top = m;}
开发者ID:gered,项目名称:MyGameFramework,代码行数:12,


示例29: DrawLineCircle

	void DrawLineCircle(const Vector2Df& pos, float spaceing, float radius)	{		float radSpacing = DegreesToRadians(spaceing);		DrawBegin(CL_LINES);		for(float i = 0; i <= 2 * 3.1415f; i += radSpacing)		{			clVertex3(pos.x + cos(i) * radius,				pos.y + sin(i) * radius, 0.0f);			clVertex3(pos.x + cos(i + radSpacing) * radius,	pos.y + sin(i + radSpacing) * radius, 0.0f);		}		DrawEnd();	}
开发者ID:TrevinLiberty,项目名称:CaptainLucha,代码行数:12,


示例30: cosf

void Light::Render(){    GLint ShaderProgram = renderShader->ShaderProgram;    Lights.push_back(this);    float DiffuseT[Lights.size()*4];    float AmbientT[Lights.size()*4];    float SpecularT[Lights.size()*4];    float PositionT[Lights.size()*3];    float DirectionT[Lights.size()*3];    float CAttenT[Lights.size()];    float LAttenT[Lights.size()];    float QAttenT[Lights.size()];    float SCUTT[Lights.size()];    float SEXPT[Lights.size()];    for(int i=0;i<Lights.size();++i){        DiffuseT[i*4] = Lights[i]->DiffuseColor.x;        DiffuseT[i*4+1] = Lights[i]->DiffuseColor.y;        DiffuseT[i*4+2] = Lights[i]->DiffuseColor.z;        DiffuseT[i*4+3] = Lights[i]->DiffuseColor.w;        AmbientT[i*4] = Lights[i]->AmbientColor.x;        AmbientT[i*4+1] = Lights[i]->AmbientColor.y;        AmbientT[i*4+2] = Lights[i]->AmbientColor.z;        AmbientT[i*4+3] = Lights[i]->AmbientColor.w;        SpecularT[i*4] = Lights[i]->SpecularColor.x;        SpecularT[i*4+1] = Lights[i]->SpecularColor.y;        SpecularT[i*4+2] = Lights[i]->SpecularColor.z;        SpecularT[i*4+3] = Lights[i]->SpecularColor.w;        PositionT[i*3] = Lights[i]->Position.x;        PositionT[i*3+1] = Lights[i]->Position.y;        PositionT[i*3+2] = Lights[i]->Position.z;        DirectionT[i*3] = Lights[i]->Direction.x;        DirectionT[i*3+1] = Lights[i]->Direction.y;        DirectionT[i*3+2] = Lights[i]->Direction.z;        CAttenT[i] = Lights[i]->ConstantAttenuation;        LAttenT[i] = Lights[i]->LinearAttenuation;        QAttenT[i] = Lights[i]->QuadraticAttenuation;        SCUTT[i] = cosf(DegreesToRadians(Lights[i]->SpotCutoff)); ///Convert from degrees into cos of the angle, for faster pixel shader        SEXPT[i] = Lights[i]->SpotExponent;    }    glUniform1i(glGetUniformLocation(ShaderProgram,"lightCount"),Lights.size());    glUniform4fv(glGetUniformLocation(ShaderProgram,"LightDiffuses"),Lights.size()*4,DiffuseT);    glUniform4fv(glGetUniformLocation(ShaderProgram,"LightAmbients"),Lights.size()*4,AmbientT);    glUniform4fv(glGetUniformLocation(ShaderProgram,"LightSpeculars"),Lights.size()*4,SpecularT);    glUniform3fv(glGetUniformLocation(ShaderProgram,"LightPositions"),Lights.size()*3,PositionT);    glUniform3fv(glGetUniformLocation(ShaderProgram,"LightDirections"),Lights.size()*3,DirectionT);    glUniform1fv(glGetUniformLocation(ShaderProgram,"LightConstantAttenuations"),Lights.size(),CAttenT);    glUniform1fv(glGetUniformLocation(ShaderProgram,"LightLinearAttenuations"),Lights.size(),LAttenT);    glUniform1fv(glGetUniformLocation(ShaderProgram,"LightQuadraticAttenuations"),Lights.size(),QAttenT);    glUniform1fv(glGetUniformLocation(ShaderProgram,"LightCutoffs"),Lights.size(),SCUTT);    glUniform1fv(glGetUniformLocation(ShaderProgram,"LightSpotExponents"),Lights.size(),SEXPT);}
开发者ID:0NDR,项目名称:AGE,代码行数:52,



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


C++ DelMember函数代码示例
C++ Degrees函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。