Skip to content

Commit

Permalink
fix physics crash
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy committed Dec 19, 2024
1 parent a2195fa commit fbe2641
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions prismarine-viewer/examples/webgpuRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export class WebgpuRenderer {

const ctx = this.ctx = canvas.getContext('webgpu')!

const presentationFormat = navigator.gpu.getPreferredCanvasFormat()
const presentationFormat = navigator.gpu.getPreferredCanvasFormat()!

ctx.configure({
device,
Expand Down Expand Up @@ -309,7 +309,7 @@ export class WebgpuRenderer {

this.tempTexture = device.createTexture({
size: [canvas.width, canvas.height],
format: 'bgra8unorm',
format: presentationFormat,
usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING,
//sampleCount: 4,
})
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,8 @@ async function connect (connectOptions: ConnectOptions) {

renderWrapper.preRender = () => {
// viewer.setFirstPersonCamera(null, bot.entity.yaw, bot.entity.pitch)
bot['doPhysics']()
//@ts-expect-error
bot?.doPhysics()
}


Expand Down

0 comments on commit fbe2641

Please sign in to comment.