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


C++ VC3函数代码示例

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


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

示例1:

//------------------------------------------------------------------
// Storm3D_Camera::TestPointVisibility
//------------------------------------------------------------------
bool Storm3D_Camera::TestPointVisibility(const VC3 &pointpos)
{
	if(forcedOrthogonalProjection) // Todo: real check
		return true;

	// Update vis planes, if needed
	if (visplane_update_needed) UpdateVisPlanes();

	// Back/Front planes
	float er=VC3(pointpos.x-position.x,
		pointpos.y-position.y,pointpos.z-position.z).GetDotWith(pnormals[0]);
	if (er<0) return false;
	if (er>vis_range) return false;
	
	// Side Planes
	if (VC3(pointpos.x-position.x,pointpos.y-position.y,
		pointpos.z-position.z).GetDotWith(pnormals[1])
		<0) return false;

	if (VC3(pointpos.x-position.x,pointpos.y-position.y,
		pointpos.z-position.z).GetDotWith(pnormals[2])
		<0) return false;

	// Up/Down planes
	if (VC3(pointpos.x-position.x,pointpos.y-position.y,
		pointpos.z-position.z).GetDotWith(pnormals[3])
		<0) return false;

	if (VC3(pointpos.x-position.x,pointpos.y-position.y,
		pointpos.z-position.z).GetDotWith(pnormals[4])
		<0) return false;

	// It's visible (at last)
	return true;
}
开发者ID:DeejStar,项目名称:Shadowgrounds-Redux,代码行数:38,代码来源:Storm3D_Camera.cpp

示例2: VC3

	CameraAutotilter::CameraAutotilter(game::GameMap *gameMap)
	{
		this->gameMap = gameMap;
		this->lastRotation = VC3(0,0,0);
		this->lastPosition = VC3(0,0,0);
		this->lastTime = Timer::getTime();
	}
开发者ID:DeejStar,项目名称:Shadowgrounds-Redux,代码行数:7,代码来源:CameraAutotilter.cpp

示例3: VC3

ScriptableAIDirectControl::ScriptableAIDirectControl(Game *game, Unit *unit)
{
    this->game = game;
    this->unit = unit;

    this->eventMask = 0;

    this->previousEventsOnMask = 0;
    //this->actions = AIDirectControlActions(); // does not need init
    //this->actionsToDisableAutomatically = AIDirectControlActions(); // does not need init

    this->aimMode = AIM_MODE_OFFSET_SELF;
    this->aimPosition = VC3(0,0,0);
    this->aimPositionResult = VC3(0,0,0);

    this->timerTicksAmount = 1;
    this->lastTimerCall = 0;

    this->customEventsUsed = 0;
    for (int i = 0; i < SCRIPTABLEAIDIRECTCONTROL_MAX_CUSTOM_EVENTS; i++)
    {
        this->customEventsTicksLeft[i] = 0;
        this->customEventsName[i] = NULL;
    }
}
开发者ID:bernardinus,项目名称:shadowgrounds,代码行数:25,代码来源:ScriptableAIDirectControl.cpp

示例4: applyCameraOptions

	void OptionApplier::applyCameraOptions(IStorm3D_Scene *scene)
	{
		if (SimpleOptions::getBool(DH_OPT_B_GAME_SIDEWAYS))
		{
			scene->GetCamera()->SetUpVec(VC3(0,0,1));
		} else {
			scene->GetCamera()->SetUpVec(VC3(0,1,0));
		}
	}
开发者ID:DeejStar,项目名称:Shadowgrounds-Redux,代码行数:9,代码来源:OptionApplier.cpp

示例5: VC3

VectorDamper::VectorDamper()
{
	pos = VC3(0, 0, 0);
	speed = VC3(0, 0, 0);
	target = VC3(0, 0, 0);
	mass = 1.0f;
	k = 0.1f;
	overdampFactor = 1.0f;
	calculateC();
}
开发者ID:DeejStar,项目名称:Shadowgrounds-Redux,代码行数:10,代码来源:Dampers.cpp

示例6: assert

	void DebugTrackerVisualizer::visualizeTrackers(game::tracking::ObjectTracker *objectTracker)
	{
		assert(objectTracker != NULL);

		std::vector<ITrackerObject *> trackerList = objectTracker->getAllTrackers();

		for (int i = 0; i < (int)trackerList.size(); i++)
		{
			ITrackerObject *tracker = trackerList[i];

			std::string trackerName = tracker->getType()->getTrackerTypeName();
			
			COL col = COL(0,0,1);

			VC3 pos = tracker->getTrackerPosition();
			VC3 sizes = VC3(0.1f, 0.1f, 0.1f);

			if (trackerName == "projectile")
			{
				col = COL(1.0f,0.7f,0.0f);
				sizes *= 1.5f;
			}

			VC3 c1 = VC3(pos.x - sizes.x, pos.y + sizes.y, pos.z - sizes.z);
			VC3 c2 = VC3(pos.x + sizes.x, pos.y + sizes.y, pos.z - sizes.z);
			VC3 c3 = VC3(pos.x + sizes.x, pos.y + sizes.y, pos.z + sizes.z);
			VC3 c4 = VC3(pos.x - sizes.x, pos.y + sizes.y, pos.z + sizes.z);
			VC3 cb1 = VC3(pos.x - sizes.x, pos.y - sizes.y, pos.z - sizes.z);
			VC3 cb2 = VC3(pos.x + sizes.x, pos.y - sizes.y, pos.z - sizes.z);
			VC3 cb3 = VC3(pos.x + sizes.x, pos.y - sizes.y, pos.z + sizes.z);
			VC3 cb4 = VC3(pos.x - sizes.x, pos.y - sizes.y, pos.z + sizes.z);

			float extra_offset = 0.0f + (i / 200.0f);
			VC3 cb4_extra = VC3(pos.x - sizes.x - extra_offset, pos.y - sizes.y, pos.z + sizes.z);

			disposable_scene->AddLine(c1, c2, col);
			disposable_scene->AddLine(c2, c3, col);
			disposable_scene->AddLine(c3, c4, col);
			disposable_scene->AddLine(c4, c1, col);
			disposable_scene->AddLine(cb1, cb2, col);
			disposable_scene->AddLine(cb2, cb3, col);
			disposable_scene->AddLine(cb3, cb4, col);
			disposable_scene->AddLine(cb4, cb1, col);
			disposable_scene->AddLine(c1, cb1, col);
			disposable_scene->AddLine(c2, cb2, col);
			disposable_scene->AddLine(c3, cb3, col);
			disposable_scene->AddLine(c4, cb4, col);
			disposable_scene->AddLine(c4, cb4, col);

			COL col2 = COL(0,1,1);
			disposable_scene->AddLine(c4, cb4_extra, col2);

		}
	}
开发者ID:DeejStar,项目名称:Shadowgrounds-Redux,代码行数:54,代码来源:DebugTrackerVisualizer.cpp

示例7: VC3

// Sets the position of interest and elapsed time for the camera system. Must be used before querying
// camera parameters.
void CameraSystemAim::update( VC3 positionOfInterest, int elapsedTime )
{

	cameraPosition = positionOfInterest + VC3(0, 1.395f, 0);
	targetPosition = aimPosition;
	targetPosition.y = cameraPosition.y + sinf(betaAngle);
	cameraPosition = cameraPosition + (cameraPosition-targetPosition).GetNormalized()*1.687f;
	upVector = VC3(0, 1, 0);
	QUAT tmp_quat3( (targetPosition-cameraPosition).GetNormalized(), DEG2RAD( -7.7f ));
	tmp_quat3.RotateVector( upVector );
	FOV = 70.0f;
}
开发者ID:DeejStar,项目名称:Jack-Claw,代码行数:14,代码来源:CameraSystemAim.cpp

示例8: VC3

bool Storm3D_Camera::TestBoxVisibility(const VC3 &min, const VC3 &max)
{

	if(forcedOrthogonalProjection) // Todo: real check
		return true;

	VC3 size = max - min;
	VC3 vertices[8] = 
	{
		VC3(min.x, min.y, min.z),
		VC3(min.x + size.x, min.y, min.z),
		VC3(min.x + size.x, min.y + size.y, min.z),
		VC3(min.x + size.x, min.y + size.y, min.z + size.z),
		VC3(min.x + size.x, min.y, min.z + size.z),
		VC3(min.x, min.y + min.y, min.z),
		VC3(min.x, min.y + min.y, min.z + min.z),
		VC3(min.x, min.y, min.z + min.z),
	};

	float origoDistance = position.GetRangeTo(VC3());

	bool allInside = true;
	for(int i = 0; i < 5; ++i)
	{
        bool allOutside = true;

		if(i == 0)
		{
			for(int j = 0; j < 8; ++j)
			{
				float distance = pnormals[i].GetDotWith(vertices[j]) + origoDistance + vis_range;

				allOutside = allOutside && (distance >= 0);
				allInside = allInside && (distance < 0);

				if(!allOutside && !allInside)
					break;
			}
		}

		for(int j = 0; j < 8; ++j)
		{
			float distance = pnormals[i].GetDotWith(vertices[j]) + origoDistance;

			allOutside = allOutside && (distance < 0);
			allInside = allInside && (distance >= 0);

			if(!allOutside && !allInside)
				break;
		}

        if(allOutside)
            return false;
	}

	return true;
}
开发者ID:DeejStar,项目名称:Shadowgrounds-Redux,代码行数:57,代码来源:Storm3D_Camera.cpp

示例9: VC3

	void AbstractPhysicsObject::syncInactiveImplementationObject(PHYSICS_ACTOR &obj)
	{
		if(!dynamicActor)
			return;

		if (moveToVelocity)
		{
			obj->setVelocity(velocity);
			moveToVelocity = false;
		}

		if (moveToAngularVelocity)
		{
			obj->setAngularVelocity(angularVelocity);
			moveToAngularVelocity = false;
		}

		if (doImpulse)
		{
			obj->addImpulse(impulsePosition, impulse);
			impulsePosition = VC3(0,0,0);
			impulse = VC3(0,0,0);
			doImpulse = false;
		}

		if (moveToPosition)
		{
			if (attemptedPosition)
			{
				obj->movePosition(position);
				attemptedPosition = false;
			} else {
				obj->setPosition(position);
			}
			moveToPosition = false;
		}

		if (moveToRotation)
		{
			if (attemptedRotation)
			{
				obj->moveRotation(rotation);
				attemptedRotation = false;
			} else {
				obj->setRotation(rotation);
			}
			moveToRotation = false;
		}

		this->dirty = false;
	}
开发者ID:sopyer,项目名称:Shadowgrounds,代码行数:51,代码来源:AbstractPhysicsObject.cpp

示例10: VC3

void WorldFold::resetWorldFold()
{
	for (int i = 0; i < MAX_WORLD_FOLDS; i++)
	{
		worldFoldMatrix[i].CreateIdentityMatrix();
		worldFoldResultMatrix[i].CreateIdentityMatrix();
		worldFoldExists[i] = false;
		worldFoldKey[i] = 1;
	}
	worldFoldCenter = VC3(0,0,0);

	wfCameraMatrix.CreateIdentityMatrix();
	wfCameraPosition = VC3(0,0,0);
}
开发者ID:DeejStar,项目名称:Jack-Claw,代码行数:14,代码来源:WorldFold.cpp

示例11: getScreenArea

Rect getScreenArea(const AABB &aabb, Game  *game)
{
	VC3 v[8];
	v[0] = VC3(aabb.mmin.x, aabb.mmin.y, aabb.mmin.z);
	v[1] = VC3(aabb.mmax.x, aabb.mmin.y, aabb.mmin.z);
	v[2] = VC3(aabb.mmin.x, aabb.mmax.y, aabb.mmin.z);
	v[3] = VC3(aabb.mmin.x, aabb.mmin.y, aabb.mmax.z);
	v[4] = VC3(aabb.mmax.x, aabb.mmax.y, aabb.mmin.z);
	v[5] = VC3(aabb.mmin.x, aabb.mmax.y, aabb.mmax.z);
	v[6] = VC3(aabb.mmax.x, aabb.mmin.y, aabb.mmax.z);
	v[7] = VC3(aabb.mmax.x, aabb.mmax.y, aabb.mmax.z);

	Point start = convertVC3toScreen(v[0], game);
	Point end = start;

	for(int i = 1; i < 8; ++i)
	{
		Point p = convertVC3toScreen(v[i], game);
		start.x = std::min(start.x, p.x);
		start.y = std::min(start.y, p.y);
		end.x = std::max(end.x, p.x);
		end.y = std::max(end.y, p.y);
	}

	Rect rect;
	rect.x = start.x;
	rect.y = start.y;
	rect.w = end.x - start.x;
	rect.h = end.y - start.y;

	return rect;
}
开发者ID:DeejStar,项目名称:Jack-Claw,代码行数:32,代码来源:TargetDisplayWindowUpdator.cpp

示例12: VC3

	ProgressBar::ProgressBar()
	{
		interruptPercent = 1.0f;

		timeDone = 0;
		timeTotal = 1;
		timeTick = 0;

		unit = NULL;

		label = NULL;
		doneLabel = NULL;
		interruptedLabel = NULL;

		borderImage = NULL;
		barImage = NULL;

		visible = false;
		visibilityLeftCounter = 0;

		doneTriggered = false;
		nextTickTrigger = 0;

		progressing = false;
		triggerInterrupted = false;

		progressPosition = VC3(0,0,0);
		progressAngle = 0;

		restartedWhileVisible = false;
	}
开发者ID:DeejStar,项目名称:Jack-Claw,代码行数:31,代码来源:ProgressBar.cpp

示例13: solvePath

bool ClawUnitActor::setPathTo(Unit *unit, const VC3 &destination_)
{
	VC3 destination = destination_;
	frozenbyte::ai::Path *path = solvePath(unit, unit->getPosition(), destination);
	
	// luckily, getPath may modify the destination value, if it is blocked
	// so no need to check that here.

	if (path != NULL)
	{
		unit->setPath(path);
		unit->setPathIndex(unit->getPathIndex() + 1);
		// (...path object is now contained within the unit, 
		// unit will handle it's proper deletion)
		unit->setWaypoint(unit->getPosition());
		unit->setFinalDestination(VC3(destination.x, 
			game->gameMap->getScaledHeightAt(destination.x, destination.z), 
			destination.z));
		return true;
	} else {		
		unit->setPath(NULL);
		unit->setFinalDestination(unit->getPosition());
		unit->setWaypoint(unit->getPosition());
		return false;
	} 
}
开发者ID:DeejStar,项目名称:Jack-Claw,代码行数:26,代码来源:ClawUnitActor.cpp

示例14: Storm3D_SpotlightData

	Storm3D_SpotlightData(Storm3D &storm_, IDirect3D9 &d3d, IDirect3DDevice9 &device_, bool ps14_, bool ps20_)
	:	storm(storm_),
		device(device_),
		properties(device),
		coneColorMultiplier(0.3f),
		//smoothness(5.f),
		smoothness(5.f),
		ps14(ps14_),
		ps20(ps20_),
		smoothing(false),
		spotlightAlwaysVisible(false),
		camera(&storm),
		hasFade(false),
		hasCone(false),
		scissorRect(true),
		hasShadows(false),
		enabled(true),
		visible(false),
		coneUpdated(false),

		updateCone(true),
		noShadowModel(0),
		light_type(IStorm3D_Spotlight::Directional),
		coneFov(0)
	{
		properties.direction = VC3(0, 0, 1.f);
		properties.color = COL(1.f, 1.f, 1.f);
		shadowMap = staticBuffers.getShadowMap();

		angle[0] = angle[1] = 0.f;
		speed[0] = 0.07f;
		speed[1] = -0.11f;
	}
开发者ID:DeejStar,项目名称:Jack-Claw,代码行数:33,代码来源:storm3d_spotlight.cpp

示例15: VC3

	void DebugVisualizerTextUtil::renderText(const VC3 &position, int offsetX, int offsetY, const char *text)
	{
		if (ui::defaultIngameFont != NULL)
		{
			IStorm3D_Font *f = ((OguiStormFont *)ui::defaultIngameFont)->fnt;

			if (text == NULL)
				text = "(null)";

			VC3 pos = position;
			VC3 result = VC3(0,0,0);
			float rhw = 0;
			float real_z = 0;
			IStorm3D_Camera *cam = disposable_scene->GetCamera();
			bool infront = cam->GetTransformedToScreen(pos, result, rhw, real_z);

			if (infront)
			{
				bool offscreen = false;
				int x = (int)(result.x * scr_width);
				int y = (int)(result.y * scr_height);
				if (x < 0 || y < 0 || x >= scr_width || y >= scr_height)
					offscreen = true;

				if (!offscreen)
				{
					float scrfloatx = (float)(x + offsetX);
					float scrfloaty = (float)(y + offsetY);
					float alpha = 1.0f;
					COL col = COL(1,1,1);
					disposable_scene->Render2D_Text(f, VC2(scrfloatx, scrfloaty), VC2(16, 16), text, alpha, col);
				}
			}
		}
	}
开发者ID:DeejStar,项目名称:Jack-Claw,代码行数:35,代码来源:DebugVisualizerTextUtil.cpp


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