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

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

51自学网 2021-06-03 09:36:59
  C++
这篇教程C++ vector4函数代码示例写得很实用,希望能帮到您。

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

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

示例1: addDynamicOccluder

void addDynamicOccluder(ZTransform* aTransform) {	int i;	FOccluderBox	obox;    tvector3		extend(1,1,1);	const tmatrix& boxmat = aTransform->GetWorldMatrix();	for (i=0; i<8; i++)	{        tvector3 bvt(BoxCorners[i].x, BoxCorners[i].y, BoxCorners[i].z),bvt2;		bvt2.TransformPoint((bvt*extend), boxmat);        obox.mVertex[i] = vector4(bvt2.x, bvt2.y, bvt2.z, 0);	}	for (i=0; i<6; i++)	{		tvector3 cross = obox.mVertex[FaceVertexIndex[i][1]];		cross -= obox.mVertex[FaceVertexIndex[i][0]];		tvector3 cr2 = obox.mVertex[FaceVertexIndex[i][2]];		cr2 -= obox.mVertex[FaceVertexIndex[i][0]];        cross.Cross(cr2);		obox.mPlanes[i] = vector4(cross.x, cross.y, cross.z, 0);        obox.mPlanes[i].Normalize();		obox.mPlanes[i].w = -DotProduct(obox.mPlanes[i], obox.mVertex[FaceVertexIndex[i][0]]);		obox.mVertex[i].w = fabs(obox.mPlanes[i].Dot( cross));		// save area in vertex w component	}    obox.mCenter = vector4(boxmat.m16[12], boxmat.m16[13], boxmat.m16[14], 0);	obox.mCenter.w = Distance(obox.mCenter, obox.mVertex[0]);	gOccluderBoxes.push_back(obox);}
开发者ID:pulkomandy,项目名称:.theRush-,代码行数:33,


示例2: perspective

GLCamera::GLCamera(float aspect){	near = 0.1f; 	far = 100.0f; 	fovy = 67.0f; 	//aspect = (float)g_gl_width / (float)g_gl_height;	this->aspect = aspect;	proj_mat = perspective(fovy, this->aspect, near, far);	cam_speed = 5.0f; 	cam_heading_speed = 100.0f;	cam_heading = 0.0f; 	cam_pos = vector3(0.0f, 0.0f, 5.0f);	T = identity_mat4().translate( vector3(-cam_pos.v[0], -cam_pos.v[1], -cam_pos.v[2]) );	create_versor(quaternion, -cam_heading, 0.0f, 1.0f, 0.0f);	quat_to_mat4(R.m, quaternion);	// combine the inverse rotation and transformation to make a view matrix	view_mat = R * T;	// keep track of some useful vectors that can be used for keyboard movement	fwd = vector4(0.0f, 0.0f, -1.0f, 0.0f);	rgt = vector4(1.0f, 0.0f, 0.0f, 0.0f);	up = vector4(0.0f, 1.0f, 0.0f, 0.0f);	cam_yaw = 0.0f; // y-rotation in degrees	cam_pitch = 0.0f;	cam_roll = 0.0;}
开发者ID:MoraxAlvizo,项目名称:ProyectoADA,代码行数:30,


示例3: identity_mat4

// returns a view matrix using the opengl lookAt style. COLUMN ORDER.void GLCamera::look_at(const vector3& pos, vector3 targ_pos, const vector3& up_v) {	this->cam_pos = pos; 	// inverse translation	matriz4x4 p = identity_mat4();	p = p.translate(vector3(-pos.v[0], -pos.v[1], -pos.v[2]));	// distance vector	vector3 d = targ_pos - pos;	// forward vector	vector3 f = d.normalise();	// right vector	vector3 r = cross(f, up_v).normalise();	// real up vector	vector3 u = cross(r, f).normalise();	matriz4x4 ori = identity_mat4();	ori.m[0] = r.v[0];	ori.m[4] = r.v[1];	ori.m[8] = r.v[2];	ori.m[1] = u.v[0];	ori.m[5] = u.v[1];	ori.m[9] = u.v[2];	ori.m[2] = -f.v[0];	ori.m[6] = -f.v[1];	ori.m[10] = -f.v[2];	R = ori;	T = p;	view_mat = R * T;	// recalc axes to suit new orientation	mat4_to_quat(quaternion, R.m);	fwd = R * vector4(0.0, 0.0, -1.0, 0.0);	rgt = R * vector4(1.0, 0.0, 0.0, 0.0);	up  = R * vector4(0.0, 1.0, 0.0, 0.0);}
开发者ID:MoraxAlvizo,项目名称:ProyectoADA,代码行数:36,


示例4: vector3

//--- Non Standard Singleton Methodsbool MyBoundingBoxClass::IsColliding(MyBoundingBoxClass* const a_pOther){	//Get all vectors in global space	vector3 v3Min = vector3(m_m4ToWorld * vector4(m_v3Min, 1.0f));	vector3 v3Max = vector3(m_m4ToWorld * vector4(m_v3Max, 1.0f));	vector3 v3MinO = vector3(a_pOther->m_m4ToWorld * vector4(a_pOther->m_v3Min, 1.0f));	vector3 v3MaxO = vector3(a_pOther->m_m4ToWorld * vector4(a_pOther->m_v3Max, 1.0f));	/*	Are they colliding?	For boxes we will assume they are colliding, unless at least one of the following conditions is not met	*/	bool bColliding = true;		//Check for X	if (m_v3MaxG.x < a_pOther->m_v3MinG.x)		bColliding = false;	if (m_v3MinG.x > a_pOther->m_v3MaxG.x)		bColliding = false;	//Check for Y	if (m_v3MaxG.y < a_pOther->m_v3MinG.y)		bColliding = false;	if (m_v3MinG.y > a_pOther->m_v3MaxG.y)		bColliding = false;	//Check for Z	if (m_v3MaxG.z < a_pOther->m_v3MinG.z)		bColliding = false;	if (m_v3MinG.z > a_pOther->m_v3MaxG.z)		bColliding = false;	return bColliding;}
开发者ID:JeremyAstolfi,项目名称:Manta-Race,代码行数:36,


示例5: vector4

const vector4 &CCoordSysAxis::Vector4() const{	static const vector4 vs[4] = {		vector4(1,0,0,0),		vector4(0,1,0,0),		vector4(0,0,1,0)	};	return vs[m_id];}
开发者ID:ducis,项目名称:pile-of-cpp,代码行数:8,


示例6: return

// Returns the debug visualization color which is used in RenderDebug().// This depends on the state of the rigid body which owns this state (if any):// yellow:  no rigid body attached to pShape// green:   rigid body is enabled// blue:    ridig body is disabledvector4 CShape::GetDebugVisualizationColor() const{	return (pRigidBody) ?				((pRigidBody->IsEnabled()) ?					vector4(0.0f, 1.0f, 0.0f, 0.75f) :					vector4(0.0f, 0.0f, 1.0f, 0.75f)) :				vector4(1.0f, 1.0f, 0.0f, 0.3f);}
开发者ID:moltenguy1,项目名称:deusexmachina,代码行数:13,


示例7: BuildRay

bool CGizmoTransformMove::GetOpType(MOVETYPE &type, unsigned int x, unsigned int y){    tvector3 rayOrigin, rayDir, df;    BuildRay(x, y, rayOrigin, rayDir);    m_svgMatrix = *m_pMatrix;    tvector3 trss(GetTransformedVector(0).Length(),        GetTransformedVector(1).Length(),        GetTransformedVector(2).Length());    tmatrix mt;    if (mLocation == LOCATE_LOCAL)    {        mt = *m_pMatrix;        mt.V4.position += vector4(m_Offset, 0.0f);        mt.Inverse();    }    else    {        // world        tvector4 pos = m_pMatrix->V4.position;        pos += vector4(m_Offset, 0.0f);        mt.Translation(-pos);    }    // plan 1 : X/Z    df = RayTrace2(rayOrigin, rayDir, GetTransformedVector(1), mt, trss, false);    if ( ( df.x >= 0 ) && (df.x <= 1) && ( fabs(df.z) < 0.1f ) ) { type = MOVE_X; return true; }    else if ( ( df.z >= 0 ) && (df.z <= 1) && ( fabs(df.x) < 0.1f ) ){ type = MOVE_Z; return true; }    else if ( (df.x<0.5f) && (df.z<0.5f) && (df.x>0) && (df.z>0)) { type = MOVE_XZ; return true; }    else {        //plan 2 : X/Y        df = RayTrace2(rayOrigin, rayDir, GetTransformedVector(2), mt, trss, false);        if ( ( df.x >= 0 ) && (df.x <= 1) && ( fabs(df.y) < 0.1f ) ) { type = MOVE_X; return true; }        if ( ( df.y >= 0 ) && (df.y <= 1) && ( fabs(df.x) < 0.1f ) ) { type = MOVE_Y; return true; }        else if ( (df.x<0.5f) && (df.y<0.5f) && (df.x>0) && (df.y>0)) { type = MOVE_XY; return true; }        else        {            //plan 3: Y/Z            df = RayTrace2(rayOrigin, rayDir, GetTransformedVector(0), mt, trss, false);            if ( ( df.y >= 0 ) && (df.y <= 1) && ( fabs(df.z) < 0.1f ) ) { type = MOVE_Y; return true; }            else if ( ( df.z >= 0 ) && (df.z <= 1) && ( fabs(df.y) < 0.1f ) ) { type = MOVE_Z; return true; }            else if ( (df.y<0.5f) && (df.z<0.5f) && (df.y>0) && (df.z>0)) { type = MOVE_YZ; return true; }        }    }    type = MOVE_NONE;    return false;}
开发者ID:hkrn,项目名称:LibGizmo,代码行数:55,


示例8: create_versor

void GLCamera::movePitchDown(double elapsed_seconds){	cam_pitch -= cam_heading_speed * elapsed_seconds;	float q_pitch[16];	create_versor(q_pitch, cam_pitch, rgt.v[0], rgt.v[1], rgt.v[2]);	mult_quat_quat(quaternion, q_pitch, quaternion);	// recalc axes to suit new orientation	quat_to_mat4(R.m, quaternion);	fwd = R * vector4(0.0, 0.0, -1.0, 0.0);	rgt = R * vector4(1.0, 0.0, 0.0, 0.0);	up = R * vector4(0.0, 1.0, 0.0, 0.0);}
开发者ID:MoraxAlvizo,项目名称:ProyectoADA,代码行数:13,


示例9: PointScreen2Camera

void DecoScene::PointScreen2WorldRay(const vector2& pt, vector3& outOrigin, vector3& outDir) const {	vector3 viewVec = PointScreen2Camera(pt);	matrix44 invview;	RI->GetTransform(TT_WorldToCamera, invview);	invview.invert();	if (camera->isOrthogonal())	{		vector4 viewOrigin(viewVec);		viewOrigin.z = 0.f;		vector4 viewDir(0, 0, -1, 0);		viewOrigin.w = 1.f;		viewOrigin = invview * vector4(viewOrigin);		vector4 worldVec = invview * viewDir;		outOrigin = vector3(viewOrigin.x, viewOrigin.y, viewOrigin.z);		outDir = vector3(worldVec.x, worldVec.y, worldVec.z);	}	else	{		viewVec.normalize();		outOrigin = camera->getEye();			vector4 worldVec = invview * vector4(viewVec);		outDir = vector3(worldVec.x, worldVec.y, worldVec.z);	}}
开发者ID:ksaishashank,项目名称:ProjectSoft,代码行数:50,


示例10: switch

void CTriangle::Render( uint32 i_iPass ){	switch( i_iPass )	{	case ePass_Lighting: break;	}	CGraphics *pGraphics = m_pParent->pGetParent()->pGetGraphics();	CCamera *pCurCamera = pGraphics->pGetCurCamera();	matrix44 matWorld; matMatrix44Identity( matWorld );	pCurCamera->SetWorldMatrix( matWorld );	m_pVertexShader->SetMatrix( m3dsc_worldmatrix, pCurCamera->matGetWorldMatrix() );	m_pVertexShader->SetMatrix( m3dsc_viewmatrix, pCurCamera->matGetViewMatrix() );	m_pVertexShader->SetMatrix( m3dsc_projectionmatrix, pCurCamera->matGetProjectionMatrix() );	m_pVertexShader->SetMatrix( m3dsc_wvpmatrix, pCurCamera->matGetWorldMatrix() * pCurCamera->matGetViewMatrix() * pCurCamera->matGetProjectionMatrix() );	vector3 vCamPos = pCurCamera->vGetPosition();	m_pVertexShader->SetVector( 0, vector4( vCamPos.x, vCamPos.y, vCamPos.z, 0 ) );	CLight *pLight = m_pParent->pGetCurrentLight();		vector3 vLightPos = pLight->vGetPosition();	m_pVertexShader->SetVector( 1, vector4( vLightPos.x, vLightPos.y, vLightPos.z, 0 ) );		m_pPixelShader->SetVector( 0, pLight->vGetColor() );	pGraphics->SetVertexFormat( m_pVertexFormat );	pGraphics->SetVertexStream( 0, m_pVertexBuffer, 0, sizeof( vertexformat ) );	pGraphics->SetVertexShader( m_pVertexShader );	pGraphics->SetPixelShader( m_pPixelShader );	CResManager *pResManager = m_pParent->pGetParent()->pGetResManager();	CTexture *pTexture = (CTexture *)pResManager->pGetResource( m_hTexture );	pGraphics->SetTexture( 0, pTexture->pGetTexture() );		CTexture *pNormalmap = (CTexture *)pResManager->pGetResource( m_hNormalmap );	pGraphics->SetTexture( 1, pNormalmap->pGetTexture() );	for( uint32 i = 0; i < 2; ++i )	{		pGraphics->SetTextureSamplerState( i, m3dtss_addressu, m3dta_clamp );		pGraphics->SetTextureSamplerState( i, m3dtss_addressv, m3dta_clamp );	}	pGraphics->pGetM3DDevice()->DrawPrimitive( m3dpt_trianglelist, 0, 1 );}
开发者ID:stephanreiter,项目名称:muli3d,代码行数:48,


示例11: vector4

void AppClass::InitWindow(String a_sWindowName){	super::InitWindow("SLERP - GREG ROZMARYNOWYCZ"); // Window Name	//Setting the color to black	m_v4ClearColor = vector4(0.0f);}
开发者ID:thunder033,项目名称:ReEngineApp_2015s,代码行数:7,


示例12: ExecuteError

// outputs vector with: center, height, hwhm, area// returns values corresponding to peak_traitsvector<double> Guess::estimate_peak_parameters() const{    // find the highest point, which must be higher than the previous point    // and not lower than the next one (-> it cannot be the first/last point)    int pos = -1;    if (!sigma_.empty()) {        for (int i = 1; i < (int) yy_.size() - 1; ++i) {            int t = (pos == -1 ? i-1 : pos);            if (sigma_[t] * yy_[i] > sigma_[i] * yy_[t] &&                    sigma_[i+1] * yy_[i] >= sigma_[i] * yy_[i+1])                pos = i;        }    } else {        for (int i = 1; i < (int) yy_.size() - 1; ++i) {            int t = (pos == -1 ? i-1 : pos);            if (yy_[i] > yy_[t] && yy_[i] >= yy_[i+1])                pos = i;        }    }    if (pos == -1)        throw ExecuteError("Peak outside of the range.");    double height = yy_[pos] * settings_->height_correction;    double center = xx_[pos];    double area;    double hwhm = find_hwhm(pos, &area) * settings_->width_correction;    return vector4(center, height, hwhm, area);}
开发者ID:acruzpr,项目名称:fityk,代码行数:30,


示例13: gth

void CGizmoTransformRotate::Rotate1Axe(const tvector3& rayOrigin,const tvector3& rayDir){    tvector3 inters;    m_plan=vector4(m_pMatrix->GetTranslation(), m_Axis2);    m_plan.RayInter(inters,rayOrigin,rayDir);    ptd = inters;    tvector3 df = inters - m_pMatrix->GetTranslation();    df.Normalize();    m_LockVertex2 = df;    float acosng = df.Dot(m_LockVertex);    m_Ng2 = (float)acos(acosng);    if (df.Dot(m_Vty)>0)        m_Ng2 = -m_Ng2;    tmatrix mt,mt2;    if (m_bUseSnap)    {        m_Ng2*=(360.0f/ZPI);        SnapIt(m_Ng2,m_AngleSnap);        m_Ng2/=(360.0f/ZPI);    }    mt.RotationAxis(m_Axis,m_Ng2);    mt.Multiply(m_InvOrigScale);    mt.Multiply(m_svgMatrix);    mt2 = m_OrigScale;    mt2.Multiply(mt);    *m_pMatrix=mt2;    if (m_Axis == tvector3::ZAxis)    {        if (mEditQT)        {            /*            Dans le cadre du jeu, et vu les pb avec les quaternions,            le 1er float du quaternion en stockage est l'angle en radian.            le stockage reste un quaternion.            il y a des pbs de conversion quaternion/matrix            */#if USE_QUATERNION            tquaternion gth(*m_pMatrix);            gth.Normalize();            gth.UnitInverse();            tquaternion qtg;            qtg.RotationAxis(m_Axis,m_Ng2);            *mEditQT = gth;//gth+qtg;//tquaternion(mt2);            mEditQT->Normalize();#else            mEditQT->z = m_Ng2;#endif        }    }}
开发者ID:sunragav,项目名称:LibGizmo,代码行数:60,


示例14: vector1

	void llquat_test_object_t::test<2>()	{		LLMatrix4 llmat;		LLVector4 vector1(2.0f, 1.0f, 3.0f, 6.0f);		LLVector4 vector2(5.0f, 6.0f, 0.0f, 1.0f);		LLVector4 vector3(2.0f, 1.0f, 2.0f, 9.0f);		LLVector4 vector4(3.0f, 8.0f, 1.0f, 5.0f);		llmat.initRows(vector1, vector2, vector3, vector4);		ensure("explicit LLQuaternion(const LLMatrix4 &mat) failed", 2.0f == llmat.mMatrix[0][0] &&										 	1.0f == llmat.mMatrix[0][1] &&											3.0f == llmat.mMatrix[0][2] &&											6.0f == llmat.mMatrix[0][3] &&											5.0f == llmat.mMatrix[1][0] &&											6.0f == llmat.mMatrix[1][1] &&											0.0f == llmat.mMatrix[1][2] &&											1.0f == llmat.mMatrix[1][3] &&											2.0f == llmat.mMatrix[2][0] &&											1.0f == llmat.mMatrix[2][1] &&											2.0f == llmat.mMatrix[2][2] &&											9.0f == llmat.mMatrix[2][3] &&											3.0f == llmat.mMatrix[3][0] &&											8.0f == llmat.mMatrix[3][1] &&											1.0f == llmat.mMatrix[3][2] &&											5.0f == llmat.mMatrix[3][3]);	}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:26,


示例15: Shading

DecoColor Shading(const vector3& realIntersectPt, const vector3& norm, DecoLight** lights, INT numLights, const vector3& viewPos, DecoMaterial* mat){	DecoColor col(0, 0, 0);	vector3 matDiffuse, matSpecular, matAmbient;	vector3 lightPos, lightDiffuse, lightSpecular, lightAmbient;	if (mat)	{		matDiffuse = mat->GetDiffuse();		matSpecular = mat->GetSpecular();		matAmbient = mat->GetAmbient();	}	else	{		matDiffuse = vector3(1, 1, 1);		matSpecular = vector3(0, 0, 0);		matAmbient = vector3(0.5, 0.5, 0.5);	}	for (INT i = 0; i < numLights; i++)	{		lightPos = lights[i]->GetPosition();		lightDiffuse = lights[i]->GetDiffuse();		lightSpecular = lights[i]->GetSpecular();		col += Shading(realIntersectPt, norm, lightPos,  viewPos, lightDiffuse, lightSpecular, lightAmbient, matDiffuse, matSpecular, matAmbient);	}			lightAmbient = vector3(0.5, 0.5, 0.5);	col += DecoColor(vector4(lightAmbient.x * matAmbient.x, lightAmbient.y * matAmbient.y, lightAmbient.z * matAmbient.z, 1));	return col;}
开发者ID:ksaishashank,项目名称:ProjectSoft,代码行数:29,


示例16: model

void LightManager::renderDebugVisualization(const matrix44& viewProjection){	for (size_t i = 0; i < m_lightSources.size(); i++)	{		if (m_lightSources[i].lightSource.type == LightType::OmniLight)		{			matrix44 model;			model.set_translation(m_lightSources[i].lightSource.position);			m_lightSources[i].lineDebugVis->renderWithStandardGpuProgram(model * viewProjection, m_lightSources[i].lightSource.diffuseColor, false);		}		else		{			matrix44 model(m_lightSources[i].lightSource.orientation);			model.set_translation(m_lightSources[i].lightSource.position);			m_lightSources[i].lineDebugVis->renderWithStandardGpuProgram(model * viewProjection, m_lightSources[i].lightSource.diffuseColor, true);			auto program = framework::StandardGpuPrograms::getArrowRenderer();			if (program->use())			{				program->setVector<StandardUniforms>(STD_UF::ORIENTATION, m_lightSources[i].lightSource.orientation);				program->setVector<StandardUniforms>(STD_UF::POSITION, m_lightSources[i].lightSource.position);				program->setMatrix<StandardUniforms>(STD_UF::MODELVIEWPROJECTION_MATRIX, viewProjection);				program->setVector<StandardUniforms>(STD_UF::COLOR, vector4(m_lightSources[i].lightSource.diffuseColor));				glDrawArrays(GL_POINTS, 0, 1);			}		}	}}
开发者ID:rokuz,项目名称:DemoOpenGL,代码行数:29,


示例17: vector4

void AppClass::InitWindow(String a_sWindowName){	super::InitWindow("MIDTERM DEMO"); // Window Name	m_pSystem->SetWindowWidth(720); //Set window dimensions	m_pSystem->SetWindowHeight(720);	m_v4ClearColor = vector4(0.4f, 0.6f, 0.9f, 0.0f);//Set clear color}
开发者ID:icicle-tricycle,项目名称:Lab_Rat,代码行数:7,


示例18: CMyCamera

bool CApp::bCreateWorld(){	m_pCamera = 0;	m_hCrystal = 0;	// Create and setup camera ------------------------------------------------	m_pCamera = new CMyCamera( pGetGraphics() );	if( !m_pCamera->bCreateRenderCamera( iGetWindowWidth(), iGetWindowHeight() ) )		return false;	m_pCamera->CalculateProjection( M3D_PI / 6.0f, 2000.0f, 10.0f );	m_pCamera->SetPosition( vector3( 0, 0, -750 ) );	m_pCamera->SetLookAt( vector3( 0, 0, 0 ), vector3( 0, 1, 0 ) );	m_pCamera->CalculateView();	pGetScene()->SetClearColor( vector4( 0, 0, 0.5f, 0 ) );	// Register bubble-entity and create an instance --------------------------	pGetScene()->RegisterEntityType( "crystal", CCrystal::pCreate );	m_hCrystal = pGetScene()->hCreateEntity( "crystal" );	if( !m_hCrystal )		return false;	CCrystal *pCrystal = (CCrystal *)pGetScene()->pGetEntity( m_hCrystal );	if( !pCrystal->bInitialize( "headobject.obj", "turtlebase.png", "turtlenormals.png" ) )		return false;	return true;}
开发者ID:funcman,项目名称:Muli3D,代码行数:30,


示例19: CMyCamera

bool CApp::bCreateWorld(){	m_pCamera = 0;	m_hBubble = 0;	// Create and setup camera ------------------------------------------------	m_pCamera = new CMyCamera( pGetGraphics() );	if( !m_pCamera->bCreateRenderCamera( iGetWindowWidth(), iGetWindowHeight() ) )		return false;	m_pCamera->CalculateProjection( M3D_PI / 6.0f, 1000.0f, 1.0f );	m_pCamera->SetPosition( vector3( 0, 0, -100 ) );	m_pCamera->SetLookAt( vector3( 0, 0, 0 ), vector3( 0, 1, 0 ) );	m_pCamera->CalculateView();	pGetScene()->SetClearColor( vector4( 0, 0, 0.5f, 0 ) );	// Register bubble-entity and create an instance --------------------------	pGetScene()->RegisterEntityType( "bubble", CBubble::pCreate );	m_hBubble = pGetScene()->hCreateEntity( "bubble" );	if( !m_hBubble )		return false;	CBubble *pBubble = (CBubble *)pGetScene()->pGetEntity( m_hBubble );	if( !pBubble->bInitialize( 20.0f, 16, 16 ) )		return false;	return true;}
开发者ID:stephanreiter,项目名称:muli3d,代码行数:30,


示例20: getHeadingSpeed

void GLCamera::moveYawLeft(double elapsed_seconds){	cam_yaw += getHeadingSpeed() * elapsed_seconds;	// create a quaternion representing change in heading (the yaw)	float q_yaw[16];	create_versor(q_yaw, cam_yaw, up.v[0], up.v[1], up.v[2]);	// add yaw rotation to the camera's current orientation	mult_quat_quat(quaternion, q_yaw, quaternion);	// recalc axes to suit new orientation	quat_to_mat4(R.m, quaternion);	fwd = R * vector4(0.0, 0.0, -1.0, 0.0);	rgt = R * vector4(1.0, 0.0, 0.0, 0.0);	up  = R * vector4(0.0, 1.0, 0.0, 0.0);}
开发者ID:MoraxAlvizo,项目名称:ProyectoADA,代码行数:17,


示例21: vector4

void AppClass::InitWindow(String a_sWindowName){	super::InitWindow("Joseph Horsmann & Veronica Lesnar A08 - Camera Singleton"); // Window Name	// Set the clear color based on Microsoft's CornflowerBlue (default in XNA)	//if this line is in Init Application it will depend on the .cfg file, if it	//is on the InitVariables it will always force it regardless of the .cfg	m_v4ClearColor = vector4(0.4f, 0.6f, 0.9f, 0.0f);}
开发者ID:VLesnar,项目名称:ReEngineApp_2015s,代码行数:8,


示例22: vector3

///////////////////////////////////////////////////////////////////////Method: IsColliding//Usage: Asks if there is a collision with another Bounding Object Object//Arguments://MyBOClass* const a_pOther -> Other object to check collision with//Output: bool -> check of the collision/////////////////////////////////////////////////////////////////////bool MyBOClass::IsColliding(MyBOClass* const a_pOther){	//Get all vectors in global space	vector3 v3Min = vector3(m_m4ToWorld * vector4(m_v3Min, 1.0f));	vector3 v3Max = vector3(m_m4ToWorld * vector4(m_v3Max, 1.0f));	vector3 v3MinO = vector3(a_pOther->m_m4ToWorld * vector4(a_pOther->m_v3Min, 1.0f));	vector3 v3MaxO = vector3(a_pOther->m_m4ToWorld * vector4(a_pOther->m_v3Max, 1.0f));	/*	Are they colliding?	For Objects we will assume they are colliding, unless at least one of the following conditions is not met	*/	//first check the bounding sphere, if that is not colliding we can guarantee that there are no collision	//if ((m_fRadius + a_pOther->m_fRadius) < glm::distance(m_v3CenterG, a_pOther->m_v3CenterG))	//	return false;	//If the distance was smaller it might be colliding	//Do precheck with AABO	bool bColliding = true;		//Check for X	if (m_v3MaxG.x < a_pOther->m_v3MinG.x)		bColliding = false;	if (m_v3MinG.x > a_pOther->m_v3MaxG.x)		bColliding = false;	//Check for Y	if (m_v3MaxG.y < a_pOther->m_v3MinG.y)		bColliding = false;	if (m_v3MinG.y > a_pOther->m_v3MaxG.y)		bColliding = false;	//Check for Z	if (m_v3MaxG.z < a_pOther->m_v3MinG.z)		bColliding = false;	if (m_v3MinG.z > a_pOther->m_v3MaxG.z)		bColliding = false;	if (bColliding == false)		return false;	return SAT(a_pOther);}
开发者ID:ilanisakov,项目名称:RailShooter,代码行数:52,


示例23: FUNC_FAILING

result CMuli3DRenderTarget::ClearDepthBuffer( float32 i_fDepth, const m3drect *i_pRect ){    if( !m_pDepthBuffer )    {        FUNC_FAILING( "CMuli3DRenderTarget::ClearDepthBuffer: no depthbuffer has been set./n" );        return e_invalidstate;    }    return m_pDepthBuffer->Clear( vector4( i_fDepth, 0, 0, 0 ), i_pRect );}
开发者ID:stephanreiter,项目名称:muli3d,代码行数:10,


示例24: RayTrace

tvector3 CGizmoTransformMove::RayTrace(tvector3& rayOrigin, tvector3& rayDir, tvector3& norm){	tvector3 df,inters;	m_plan=vector4(m_pMatrix->GetTranslation(), norm);	m_plan.RayInter(inters,rayOrigin,rayDir);	ptd = inters;	df = inters - m_pMatrix->GetTranslation();	df /=GetScreenFactor();	m_LockVertex = inters;	return df;}
开发者ID:BSVino,项目名称:Digitanks,代码行数:11,



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


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