mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-20 04:14:12 +01:00
feat: syncronize tank model
This commit is contained in:
1 parent
e47b1315a9
commit
a0eb0d54f0
4 files changed
+53
-71
No files matched your search
+38
-10
@@ -7,14 +7,42 @@ import { Duel } from '../../../../../../../../stores/duel';
|
||||
|
||||
const modelDefinitions = await awaitableModelDefinitions;
|
||||
|
||||
const surfaceMaterial = new MeshBasicMaterial({
|
||||
color: mauveDark.mauve6,
|
||||
toneMapped: false,
|
||||
});
|
||||
const outlineMaterial = new LineBasicMaterial({
|
||||
color: mauveDark.mauve8,
|
||||
toneMapped: false,
|
||||
});
|
||||
const surfaceMaterial: Record<Props['only'], MeshBasicMaterial> = {
|
||||
gun: new MeshBasicMaterial({
|
||||
color: mauveDark.mauve11,
|
||||
toneMapped: false,
|
||||
}),
|
||||
turret: new MeshBasicMaterial({
|
||||
color: mauveDark.mauve6,
|
||||
toneMapped: false,
|
||||
transparent: true,
|
||||
opacity: 0.25,
|
||||
}),
|
||||
body: new MeshBasicMaterial({
|
||||
color: mauveDark.mauve9,
|
||||
toneMapped: false,
|
||||
transparent: true,
|
||||
opacity: 0.5,
|
||||
}),
|
||||
};
|
||||
const outlineMaterial: Record<Props['only'], LineBasicMaterial> = {
|
||||
gun: new LineBasicMaterial({
|
||||
color: mauveDark.mauve3,
|
||||
toneMapped: false,
|
||||
}),
|
||||
turret: new LineBasicMaterial({
|
||||
color: mauveDark.mauve8,
|
||||
toneMapped: false,
|
||||
transparent: true,
|
||||
opacity: 0.25,
|
||||
}),
|
||||
body: new LineBasicMaterial({
|
||||
color: mauveDark.mauve11,
|
||||
toneMapped: false,
|
||||
transparent: true,
|
||||
opacity: 0.5,
|
||||
}),
|
||||
};
|
||||
|
||||
interface Props {
|
||||
only: 'gun' | 'turret' | 'body';
|
||||
@@ -67,8 +95,8 @@ export function ModelChunk({ only }: Props) {
|
||||
mesh(mesh, props, key) {
|
||||
return (
|
||||
<>
|
||||
<mesh key={key} {...props} material={surfaceMaterial} />
|
||||
<lineSegments material={outlineMaterial}>
|
||||
<mesh key={key} {...props} material={surfaceMaterial[only]} />
|
||||
<lineSegments material={outlineMaterial[only]}>
|
||||
<edgesGeometry args={[mesh.geometry, 29]} />
|
||||
</lineSegments>
|
||||
</>
|
||||
|
||||
+2
-2
@@ -194,8 +194,8 @@ export function GunFlexibilityVisualizer({
|
||||
transparent,
|
||||
${Var('orange-a2')} ${Math.PI / 2 - maxPitch - CONIC_TRANSITION}rad,
|
||||
|
||||
${Var('cyan-a5')} ${Math.PI / 2 - maxPitch}rad,
|
||||
${Var('jade-a5')} ${Math.PI / 2 - minPitch}rad,
|
||||
${Var('cyan-a6')} ${Math.PI / 2 - maxPitch}rad,
|
||||
${Var('jade-a6')} ${Math.PI / 2 - minPitch}rad,
|
||||
|
||||
${Var('orange-a2')} ${Math.PI / 2 - minPitch + CONIC_TRANSITION}rad,
|
||||
transparent 180deg
|
||||
|
||||
Reference in new issue
Block a user