Git Product home page Git Product logo

cabal's Introduction

cabal's People

Contributors

bdero avatar johnmccutchan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cabal's Issues

Add an input harness

Track keyboard/mouse state and provide an interface to look it up.

Then, create a game controller for marble madness.

FFI build/runtime issues

FYI @johnmccutchan

  1. Encountered this over the weekend. This error occurs at runtime while creating a rigid body:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Unsupported operation: The body is inlined in the frontend.
#0      DynamicLibraryExtension.lookupFunction (dart:ffi-patch/ffi_dynamic_library_patch.dart:67:7)
#1      new Body._ (package:cabal/physics/src/body.dart:76:46)
#2      new RigidBody._ (package:cabal/physics/src/body.dart:185:15)
#3      World.createRigidBody (package:cabal/physics/src/world.dart:52:22)
#4      CabalGame.startECS (package:cabal/game/cabal_game.dart:140:36)
#5      ECSGame.start (package:cabal/base/ecs_game.dart:39:5)
#6      GameRenderBox.attach.<anonymous closure> (package:cabal/base/game_render_box.dart:45:12)
#7      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:847:45)
#8      Future._propagateToListeners (dart:async/future_impl.dart:876:13)
#9      Future._completeWithValue (dart:async/future_impl.dart:652:5)
#10     Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:722:7)
#11     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#12     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
  1. Also, around half the the time when I try to run cabal, the following error happens. However, rerunning always clears it up:
flutter run --debug --local-engine-src-path ~/projects/flutter/engine/src --local-engine=host_debug_unopt_arm64 --local-engine-host=host_debug_unopt_arm64 -d macos --enable-impeller
Launching lib/main.dart on macOS in debug mode...
lib/physics/src/body.dart:76:46: Error: Expected type 'void Function(Pointer<WorldBody>, Float32List)' to be 'void Function(Pointer<WorldBody>, Pointer<Float>)', which is the Dart type corresponding to 'NativeFunction<Void Function(Pointer<WorldBody>, Pointer<Float>)>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'WorldBody' is from 'package:cabal/physics/src/jolt_ffi_generated.dart' ('lib/physics/src/jolt_ffi_generated.dart').
 - 'Float32List' is from 'dart:typed_data'.
 - 'Float' is from 'dart:ffi'.
 - 'NativeFunction' is from 'dart:ffi'.
 - 'Void' is from 'dart:ffi'.
  final unwrappedPositionSetter = jolt.dylib.lookupFunction<
                                             ^
lib/physics/src/body.dart:85:53: Error: Expected type 'void Function(Pointer<WorldBody>, Float32List)' to be 'void Function(Pointer<WorldBody>, Pointer<Float>)', which is the Dart type corresponding to 'NativeFunction<Void Function(Pointer<WorldBody>, Pointer<Float>)>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'WorldBody' is from 'package:cabal/physics/src/jolt_ffi_generated.dart' ('lib/physics/src/jolt_ffi_generated.dart').
 - 'Float32List' is from 'dart:typed_data'.
 - 'Float' is from 'dart:ffi'.
 - 'NativeFunction' is from 'dart:ffi'.
 - 'Void' is from 'dart:ffi'.
  static final unwrappedPositionGetter = jolt.dylib.lookupFunction<
                                                    ^
lib/physics/src/body.dart:96:53: Error: Expected type 'void Function(Pointer<WorldBody>, Float32List)' to be 'void Function(Pointer<WorldBody>, Pointer<Float>)', which is the Dart type corresponding to 'NativeFunction<Void Function(Pointer<WorldBody>, Pointer<Float>)>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'WorldBody' is from 'package:cabal/physics/src/jolt_ffi_generated.dart' ('lib/physics/src/jolt_ffi_generated.dart').
 - 'Float32List' is from 'dart:typed_data'.
 - 'Float' is from 'dart:ffi'.
 - 'NativeFunction' is from 'dart:ffi'.
 - 'Void' is from 'dart:ffi'.
  static final unwrappedRotationSetter = jolt.dylib.lookupFunction<
                                                    ^
lib/physics/src/body.dart:105:53: Error: Expected type 'void Function(Pointer<WorldBody>, Float32List)' to be 'void Function(Pointer<WorldBody>, Pointer<Float>)', which is the Dart type corresponding to 'NativeFunction<Void Function(Pointer<WorldBody>, Pointer<Float>)>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'WorldBody' is from 'package:cabal/physics/src/jolt_ffi_generated.dart' ('lib/physics/src/jolt_ffi_generated.dart').
 - 'Float32List' is from 'dart:typed_data'.
 - 'Float' is from 'dart:ffi'.
 - 'NativeFunction' is from 'dart:ffi'.
 - 'Void' is from 'dart:ffi'.
  static final unwrappedRotationGetter = jolt.dylib.lookupFunction<
                                                    ^
lib/physics/src/body.dart:116:59: Error: Expected type 'void Function(Pointer<WorldBody>, Float32List)' to be 'void Function(Pointer<WorldBody>, Pointer<Float>)', which is the Dart type corresponding to 'NativeFunction<Void Function(Pointer<WorldBody>, Pointer<Float>)>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'WorldBody' is from 'package:cabal/physics/src/jolt_ffi_generated.dart' ('lib/physics/src/jolt_ffi_generated.dart').
 - 'Float32List' is from 'dart:typed_data'.
 - 'Float' is from 'dart:ffi'.
 - 'NativeFunction' is from 'dart:ffi'.
 - 'Void' is from 'dart:ffi'.
  static final unwrappedWorldTransformGetter = jolt.dylib.lookupFunction<
                                                          ^
lib/physics/src/body.dart:127:66: Error: Expected type 'void Function(Pointer<WorldBody>, Float32List)' to be 'void Function(Pointer<WorldBody>, Pointer<Float>)', which is the Dart type corresponding to 'NativeFunction<Void Function(Pointer<WorldBody>, Pointer<Float>)>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'WorldBody' is from 'package:cabal/physics/src/jolt_ffi_generated.dart' ('lib/physics/src/jolt_ffi_generated.dart').
 - 'Float32List' is from 'dart:typed_data'.
 - 'Float' is from 'dart:ffi'.
 - 'NativeFunction' is from 'dart:ffi'.
 - 'Void' is from 'dart:ffi'.
  static final unwrapperCenterOfMassTransformGetter = jolt.dylib.lookupFunction<
                                                                 ^
lib/physics/src/shape.dart:22:54: Error: Expected type 'void Function(Pointer<CollisionShape>, Float32List)' to be 'void Function(Pointer<CollisionShape>, Pointer<Float>)', which is the Dart type corresponding to 'NativeFunction<Void Function(Pointer<CollisionShape>, Pointer<Float>)>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'CollisionShape' is from 'package:cabal/physics/src/jolt_ffi_generated.dart' ('lib/physics/src/jolt_ffi_generated.dart').
 - 'Float32List' is from 'dart:typed_data'.
 - 'Float' is from 'dart:ffi'.
 - 'NativeFunction' is from 'dart:ffi'.
 - 'Void' is from 'dart:ffi'.
  static final unwrappedGetCenterOfMass = jolt.dylib.lookupFunction<
                                                     ^
lib/physics/src/shape.dart:34:53: Error: Expected type 'void Function(Pointer<CollisionShape>, Float32List, Float32List)' to be 'void Function(Pointer<CollisionShape>, Pointer<Float>, Pointer<Float>)', which is the Dart type corresponding to 'NativeFunction<Void Function(Pointer<CollisionShape>, Pointer<Float>, Pointer<Float>)>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'CollisionShape' is from 'package:cabal/physics/src/jolt_ffi_generated.dart' ('lib/physics/src/jolt_ffi_generated.dart').
 - 'Float32List' is from 'dart:typed_data'.
 - 'Float' is from 'dart:ffi'.
 - 'NativeFunction' is from 'dart:ffi'.
 - 'Void' is from 'dart:ffi'.
  static final unwrappedGetLocalBounds = jolt.dylib.lookupFunction<
                                                    ^
lib/physics/src/shape.dart:180:56: Error: Expected type 'Pointer<CollisionShape> Function(Pointer<ConvexShapeConfig>, Float32List, int)' to be 'Pointer<CollisionShape> Function(Pointer<ConvexShapeConfig>, Pointer<Float>, int)', which is the Dart type corresponding to 'NativeFunction<Pointer<CollisionShape> Function(Pointer<ConvexShapeConfig>, Pointer<Float>, Int)>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'CollisionShape' is from 'package:cabal/physics/src/jolt_ffi_generated.dart' ('lib/physics/src/jolt_ffi_generated.dart').
 - 'ConvexShapeConfig' is from 'package:cabal/physics/src/jolt_ffi_generated.dart' ('lib/physics/src/jolt_ffi_generated.dart').
 - 'Float32List' is from 'dart:typed_data'.
 - 'Float' is from 'dart:ffi'.
 - 'NativeFunction' is from 'dart:ffi'.
 - 'Int' is from 'dart:ffi'.
  static final unwrappedCreateConvexShape = jolt.dylib.lookupFunction<
                                                       ^
lib/physics/src/shape.dart:269:54: Error: Expected type 'Pointer<CollisionShape> Function(Float32List, int, Uint32List, int)' to be 'Pointer<CollisionShape> Function(Pointer<Float>, int, Pointer<Uint32>, int)', which is the Dart type corresponding to 'NativeFunction<Pointer<CollisionShape> Function(Pointer<Float>, Int, Pointer<Uint32>, Int)>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'CollisionShape' is from 'package:cabal/physics/src/jolt_ffi_generated.dart' ('lib/physics/src/jolt_ffi_generated.dart').
 - 'Float32List' is from 'dart:typed_data'.
 - 'Uint32List' is from 'dart:typed_data'.
 - 'Float' is from 'dart:ffi'.
 - 'Uint32' is from 'dart:ffi'.
 - 'NativeFunction' is from 'dart:ffi'.
 - 'Int' is from 'dart:ffi'.
  static final unwrappedCreateMeshShape = jolt.dylib.lookupFunction<
                                                     ^
Target kernel_snapshot failed: Exception

Command PhaseScriptExecution failed with a nonzero exit code
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Flutter Assemble' from project 'Runner')
** BUILD FAILED **

Building macOS application...
Error: Build process failed

PBR forward: Add IBL/environment maps

Depends on #1 and #2.

Replace the placeholder lighting with lighting sampled from an environment map. Flutter GPU is currently missing mipmaps and cubemaps, both of which would make this easier.

As a stopgap:

  • Take the irradiance (for diffuse lighting) as an equirectangular projection.
  • For the specular part, we'll have to interpolate between textures.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.