INNER CODE UNIT · C++

axisCoeff

TombEngine/TombEngine · TombEngine/Game/camera.cpp:115

		axisCoeff = AxisMap[AxisID::Camera] * MANUAL_ROTATION_SPEED;
	
	// Accumulate extra angles to gradually rotate camera around Lara over time.
	Camera.extraAngle += ANGLE(axisCoeff.x);
	Camera.extraElevation += ANGLE(axisCoeff.y);

	// Limit vertical camera movement to avoid clipping.
	Camera.extraElevation = std::clamp(Camera.extraElevation, MANUAL_ROTATION_LOWER_ANGLE_LIMIT, MANUAL_ROTATION_UPPER_ANGLE_LIMIT);

	// Apply extra angles to target angles instead of actual angles for smooth movement.
	Camera.targetAngle += Camera.extraAngle;
	Camera.targetElevation += Camera.extraElevation;
}

static int GetLookCameraVerticalOffset(const ItemInfo& item, const CollisionInfo& coll)
{
	constexpr auto VERTICAL_OFFSET_DEFAULT		  = -BLOCK(1 / 16.0f);
	constexpr auto VERTICAL_OFFSET_SWAMP		  = BLOCK(0.4f);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…