Add javadocs to generic rendering objects
This commit is contained in:
@@ -128,6 +128,10 @@ public class DhApi
|
||||
*/
|
||||
public static IDhApiWrapperFactory wrapperFactory = null;
|
||||
|
||||
/**
|
||||
* Used to add custom objects to DH's render pass.
|
||||
* @since API 3.0.0
|
||||
*/
|
||||
public static IDhApiCustomRenderRegister renderRegister = null;
|
||||
}
|
||||
|
||||
|
||||
+10
@@ -5,6 +5,16 @@ import com.seibel.distanthorizons.api.objects.render.DhApiRenderableBox;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Handles adding, removing, and creating
|
||||
* {@link IDhApiRenderableBoxGroup} objects,
|
||||
* which can be used to render custom objects into
|
||||
* DH's terrain.
|
||||
*
|
||||
* @author James Seibel
|
||||
* @version 2024-6-30
|
||||
* @since API 3.0.0
|
||||
*/
|
||||
public interface IDhApiCustomRenderRegister
|
||||
{
|
||||
void add(IDhApiRenderableBoxGroup cubeGroup) throws IllegalArgumentException;
|
||||
|
||||
+20
-2
@@ -7,21 +7,39 @@ import com.seibel.distanthorizons.api.objects.render.DhApiRenderableBox;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* A list of {@link DhApiRenderableBox}'s that
|
||||
* can be rendered to DH's terrain pass.
|
||||
*
|
||||
* @see DhApiRenderableBox
|
||||
*
|
||||
* @author James Seibel
|
||||
* @version 2024-6-30
|
||||
* @since API 3.0.0
|
||||
*/
|
||||
public interface IDhApiRenderableBoxGroup extends List<DhApiRenderableBox>
|
||||
{
|
||||
|
||||
/** @return the ID for this specific group */
|
||||
long getId();
|
||||
|
||||
/** Sets whether this group should render or not. */
|
||||
void setActive(boolean active);
|
||||
/** @return if active this group will render. */
|
||||
boolean isActive();
|
||||
|
||||
/** Sets where this group will render in the level. */
|
||||
void setOriginBlockPos(DhApiVec3f pos);
|
||||
/** @return the block position in the level that all {@see DhApiRenderableBox} will render relative to. */
|
||||
DhApiVec3f getOriginBlockPos();
|
||||
|
||||
/**
|
||||
* Called right before this group is rendered. <br>
|
||||
* This is a good place to change the origin or notify of any box changes.
|
||||
*/
|
||||
void setPreRenderFunc(Consumer<DhApiRenderParam> renderEventParam);
|
||||
|
||||
/**
|
||||
* If a cube's color, position, or other property are changed this method
|
||||
* If a cube's color, position, or other property is changed this method
|
||||
* must be called for those changes to render. <br><br>
|
||||
*
|
||||
* Note: changing the group's position via {@link #setOriginBlockPos} doesn't
|
||||
|
||||
+31
-6
@@ -1,21 +1,46 @@
|
||||
package com.seibel.distanthorizons.api.objects.render;
|
||||
|
||||
|
||||
import com.seibel.distanthorizons.coreapi.util.math.Vec3f;
|
||||
import com.seibel.distanthorizons.api.interfaces.render.IDhApiRenderableBoxGroup;
|
||||
import com.seibel.distanthorizons.api.objects.math.DhApiVec3f;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public final class DhApiRenderableBox
|
||||
/**
|
||||
* @see IDhApiRenderableBoxGroup
|
||||
*
|
||||
* @author James Seibel
|
||||
* @version 2024-6-30
|
||||
* @since API 3.0.0
|
||||
*/
|
||||
public class DhApiRenderableBox
|
||||
{
|
||||
public Vec3f minPos;
|
||||
public Vec3f maxPos;
|
||||
/** the position closest to (-inf,-inf) */
|
||||
public DhApiVec3f minPos;
|
||||
/** the position closest to (+inf,+inf) */
|
||||
public DhApiVec3f maxPos;
|
||||
|
||||
public Color color;
|
||||
|
||||
public boolean fullBright = false;
|
||||
/* TODO */
|
||||
//public boolean fullBright = false;
|
||||
|
||||
|
||||
|
||||
public DhApiRenderableBox(Vec3f minPos, Vec3f maxPos, Color color)
|
||||
//==============//
|
||||
// constructors //
|
||||
//==============//
|
||||
|
||||
public DhApiRenderableBox(DhApiVec3f minPos, float width, Color color)
|
||||
{
|
||||
this(minPos, new DhApiVec3f(
|
||||
minPos.x + width,
|
||||
minPos.y + width,
|
||||
minPos.z + width
|
||||
), color);
|
||||
}
|
||||
|
||||
public DhApiRenderableBox(DhApiVec3f minPos, DhApiVec3f maxPos, Color color)
|
||||
{
|
||||
this.minPos = minPos;
|
||||
this.maxPos = maxPos;
|
||||
|
||||
Reference in New Issue
Block a user