OpenEnroth 4aaa0a0
Loading...
Searching...
No Matches
Functions
SpellFxRenderer.cpp File Reference
#include "Engine/SpellFxRenderer.h"
#include <algorithm>
#include "Engine/OurMath.h"
#include "Engine/Time/Timer.h"
#include "Engine/Party.h"
#include "Engine/AssetsManager.h"
#include "Engine/Graphics/Camera.h"
#include "Engine/Graphics/Indoor.h"
#include "Engine/Graphics/LightmapBuilder.h"
#include "Engine/Graphics/LightsStack.h"
#include "Engine/Graphics/ParticleEngine.h"
#include "Engine/Graphics/Sprites.h"
#include "Engine/Graphics/Renderer/Renderer.h"
#include "Engine/Objects/Actor.h"
#include "Engine/Objects/SpriteObject.h"
#include "Engine/Random/Random.h"
#include "Engine/Tables/IconFrameTable.h"

Functions

Color ModulateColor (Color diffuse, float multiplier)
 
bool ClipProjectileToViewPlane (RenderVertexSoft *p)
 

Function Documentation

◆ ClipProjectileToViewPlane()

bool ClipProjectileToViewPlane ( RenderVertexSoft p)

Clips a projectile (represented by two vertices) to the camera's view plane.

This function checks if the projectile's endpoints are in front of, behind, or on the view plane. If either endpoint is behind the view plane, it attempts to clip the projectile so that only the visible portion remains. The function modifies the positions of the vertices as needed to ensure proper clipping.

Parameters
pPointer to an array of two RenderVertexSoft objects representing the projectile's endpoints.
  • p[0]: First endpoint
  • p[1]: Second endpoint
Returns
true if the projectile is at least partially visible (after clipping), false if it is completely behind the view plane.

Details:

  • Checks the position of each endpoint relative to the view plane.
  • If both endpoints are behind the view plane, the projectile is rejected.
  • If one endpoint is behind, the function interpolates the position of the endpoint to the view plane.
  • Uses linear interpolation to calculate the intersection point with the view plane.
  • Modifies the endpoint positions in-place.

◆ ModulateColor()

Color ModulateColor ( Color  diffuse,
float  multiplier 
)