90 PN_stdfloat far_plane, LVecBase3 pos,
91 LVecBase3 direction) {
93 LMatrix4 transform_mat = LMatrix4::translate_mat(-pos);
104 LPoint3 center = (hexahedron->get_min() + hexahedron->get_max()) * 0.5f;
105 _bounds =
BoundingSphere(pos + center, (hexahedron->get_max() - center).length());
132 _needs_update = flag;
143 return _region.get_x() >= 0 && _region.get_y() >= 0 && _region.get_z() >= 0 && _region.get_w() >= 0;
196 _region_uv = region_uv;
227 nassertv(_slot >= 0);
240 nassertv(resolution > 0);
241 _resolution = resolution;
void write_to_command(GPUCommand &cmd) const
Writes the source to a GPUCommand.
void set_needs_update(bool flag)
Sets the update flag of the source.
int get_slot() const
Returns the slot of the shadow source.
This defines a bounding sphere, consisting of a center and a radius.
void push_vec4(const LVecBase4 &v)
Appends a 4-component floating point vector to the GPUCommand.
size_t get_resolution() const
Returns the resolution of the source.
const BoundingSphere & get_bounds() const
Returns the shadow sources bounds.
void set_slot(int slot)
Assigns the source a slot.
bool has_slot() const
Returns whether the source has a slot.
const LVecBase4i & get_region() const
Returns the assigned region of the source in atlas space.
void set_near_far(PN_stdfloat near_distance, PN_stdfloat far_distance)
Simultaneously changes the near and far planes.
void set_perspective_lens(PN_stdfloat fov, PN_stdfloat near_plane, PN_stdfloat far_plane, LVecBase3 pos, LVecBase3 direction)
Setups a perspective lens for the source.
const LVecBase4 & get_uv_region() const
Returns the assigned region of the source in UV space.
void set_matrix_lens(const LMatrix4 &mvp)
Sets a custom matrix for the source.
bool get_needs_update() const
RenderPipeline.
void push_mat4(const LMatrix4 &v)
Appends a floating point 4x4 matrix to the GPUCommand.
set_film_offset
Sets the horizontal and vertical offset amounts of this Lens.
A perspective-type lens: a normal camera.
const LMatrix4 & get_projection_mat(StereoChannel channel=SC_mono) const
Returns the complete transformation matrix from a 3-d point in space to a point on the film,...
bool has_region() const
Returns whether the source has a valid region.
void set_resolution(size_t resolution)
Sets the resolution of the source.
Class for storing data to be transferred to the GPU.
void set_region(const LVecBase4i ®ion, const LVecBase4 ®ion_uv)
Sets the assigned region of the source in atlas and uv space.
void set_view_vector(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat i, PN_stdfloat j, PN_stdfloat k)
Specifies the direction in which the lens is facing by giving an axis to look along,...
This defines a bounding convex hexahedron.
const LMatrix4 & get_mvp() const
Returns the View-Projection matrix of the source.
void clear_region()
Clears the assigned region of the source.