pub struct SurfaceDataPatch {
pub data_id: u64,
pub additional_vertices: Vec<u32>,
pub triangles: Vec<[u32; 3]>,
pub second_tex_coords: Vec<Vector2<f32>>,
}
Expand description
A patch for surface data that contains secondary texture coordinates and new topology for data.
It is needed for serialization: during the UV generation, generator could multiply vertices to
make seams, it adds new data to existing vertices. The problem is that we do not serialize
surface data - we store only a “link” to resource from which we’ll load surface data on
deserialization. But freshly loaded resource is not suitable for generated lightmap - in most
cases it just does not have secondary texture coordinates. So we have to patch data after loading
somehow with required data, this is where SurfaceDataPatch
comes into play.
Fields§
§data_id: u64
A surface data id. Usually it is just a hash of surface data. Can be ignored completely, if you don’t need to save patches.
additional_vertices: Vec<u32>
List of indices of vertices, that must be cloned and pushed into vertices array one by one at the end.
triangles: Vec<[u32; 3]>
New topology for surface data. Old topology must be replaced with new, because UV generator splits vertices at UV map seams.
second_tex_coords: Vec<Vector2<f32>>
List of second texture coordinates used for light maps. This list includes all the vertices added by the generation step.
Trait Implementations§
Source§impl Clone for SurfaceDataPatch
impl Clone for SurfaceDataPatch
Source§fn clone(&self) -> SurfaceDataPatch
fn clone(&self) -> SurfaceDataPatch
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SurfaceDataPatch
impl Debug for SurfaceDataPatch
Source§impl Default for SurfaceDataPatch
impl Default for SurfaceDataPatch
Source§fn default() -> SurfaceDataPatch
fn default() -> SurfaceDataPatch
Auto Trait Implementations§
impl Freeze for SurfaceDataPatch
impl RefUnwindSafe for SurfaceDataPatch
impl Send for SurfaceDataPatch
impl Sync for SurfaceDataPatch
impl Unpin for SurfaceDataPatch
impl UnwindSafe for SurfaceDataPatch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.