Divine-Star-Software / DivineVoxelEngine

A multi-threaded, renderer independent, fully customizable TypeScript voxel engine.
MIT License
202 stars 12 forks source link

Pre Alpha 1.2 Release Checklist - The Shape & Data Update #9

Closed lucasdamianjohnson closed 2 years ago

lucasdamianjohnson commented 2 years ago
lucasdamianjohnson commented 2 years ago

Changes


List of things that I will need to update the wiki for. Will also have to update the wiki for 1.1.

Voxel Data Change

So, I changed the voxel data type definition. It is now:

type VoxelData = {
    name: string;
    shapeId: string;
    id: string;
    substance: VoxelSubstanceType;
    physics?: {
    boundingBoxId: string;
    checkCollisions: boolean;
    };
    states?: string[];
    lightSource?: boolean;
    lightValue?: number;
};

This is a breaking change from other versions. But now voxel states actually work. So, when you add a state to the states array it will be passed to the voxel process function so you can do different things with it.

Also realized that the defaultState literally did nothing so I just removed it.

Voxel Process Data Change:

The voxel process data has changed.

export type VoxelProcessData = {
 exposedFaces: number[];
 faceStates: number[];
 textureRotations: Rotations[];
 voxelData: number;
 voxelState: string;
 voxelShapeState : number;
 uvTemplate: number[];
 overlayUVTemplate: number[];
 colorTemplate: number[];
 lightTemplate: number[];
 aoTemplate: number[];
 chunkX: number;
 chunkY: number;
 chunkZ: number;
 x: number;
 y: number;
 z: number;
};

World Data Changes:

paintVoxel is now:

 paintVoxel(
  voxelId: string,
  voxelStateId: string,
  shapeState : number,
  x: number,
  y: number,
  z: number
 ) {
}

And requestVoxelAdd is now:

 async requestVoxelAdd(
  voxelId: string,
  voxelStateId: string,
  shapeState : number,
  x: number,
  y: number,
  z: number
 ) {
}

Added a shape state param to each.

Changes:

Name changes:

lucasdamianjohnson commented 2 years ago

Alpha 1.2 is out now.