Skip to content

Commit

Permalink
Merge pull request #32 from playx-flutter/qa
Browse files Browse the repository at this point in the history
Update to V0.0.3
  • Loading branch information
basemosama authored Aug 31, 2023
2 parents 314f05d + 9db913a commit d75f186
Show file tree
Hide file tree
Showing 80 changed files with 453 additions and 115 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.0.3
- Enhance package imports.

## 0.0.2
- Add support for Dart 3.0.0 and Flutter 3.10

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ In the `dependencies:` section of your `pubspec.yaml`, add the following line:

```yaml
dependencies:
playx_3d_scene: ^0.0.2
playx_3d_scene: ^0.0.3
```
## Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ class PlayxEventHandler (
rendererEventSink =null
}
})

}

private fun cancelRendererEventChannel(){
Expand Down
27 changes: 2 additions & 25 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,34 +1,11 @@
import 'package:flutter/material.dart';
import 'package:playx_3d_scene/controller/playx_3d_scene_controller.dart';
import 'package:playx_3d_scene/models/model/animation.dart';
import 'package:playx_3d_scene/models/model/glb_model.dart';
import 'package:playx_3d_scene/models/scene/camera/camera.dart';
import 'package:playx_3d_scene/models/scene/camera/exposure.dart';
import 'package:playx_3d_scene/models/scene/geometry/direction.dart';
import 'package:playx_3d_scene/models/scene/geometry/position.dart';
import 'package:playx_3d_scene/models/scene/ground.dart';
import 'package:playx_3d_scene/models/scene/indirect_light/hdr_indirect_light.dart';
import 'package:playx_3d_scene/models/scene/light/light.dart';
import 'package:playx_3d_scene/models/scene/light/light_type.dart';
import 'package:playx_3d_scene/models/scene/material/material.dart';
import 'package:playx_3d_scene/models/scene/material/material_paramater.dart';
import 'package:playx_3d_scene/models/scene/material/texture/enums/texture_type.dart';
import 'package:playx_3d_scene/models/scene/material/texture/texture.dart';
import 'package:playx_3d_scene/models/scene/material/texture/texture_sampler.dart';
import 'package:playx_3d_scene/models/scene/scene.dart';
import 'package:playx_3d_scene/models/scene/skybox/hdr_skybox.dart';
import 'package:playx_3d_scene/models/shapes/cube.dart';
import 'package:playx_3d_scene/models/shapes/sphere.dart';
import 'package:playx_3d_scene/models/state/model_state.dart';
import 'package:playx_3d_scene/models/state/scene_state.dart';
import 'package:playx_3d_scene/models/state/shape_state.dart';
import 'package:playx_3d_scene/utils/result.dart';
import 'package:playx_3d_scene/view/playx_3d_scene.dart';
import 'package:playx_3d_scene/playx_3d_scene.dart';

void main() {
runApp(const MyApp());
}


class MyApp extends StatefulWidget {
const MyApp({super.key});

Expand Down
49 changes: 49 additions & 0 deletions lib/playx_3d_scene.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
export 'src/view/playx_3d_scene.dart';
export 'src/utils/result.dart';
export 'src/controller/playx_3d_scene_controller.dart';
export 'src/models/model/animation.dart';
export 'src/models/model/glb_model.dart';
export 'src/models/model/gltf_model.dart';
export 'src/models/model/model.dart';
export 'src/models/scene/camera/camera.dart';
export 'src/models/scene/camera/exposure.dart';
export 'src/models/scene/camera/lens_projection.dart';
export 'src/models/scene/camera/projection.dart';
export 'src/models/scene/camera/enums/camera_mode.dart';
export 'src/models/scene/camera/enums/fov.dart';
export 'src/models/scene/camera/enums/projection_type.dart';
export 'src/models/scene/geometry/direction.dart';
export 'src/models/scene/geometry/position.dart';
export 'src/models/scene/geometry/size.dart';
export 'src/models/scene/indirect_light/default_indirect_light.dart';
export 'src/models/scene/indirect_light/hdr_indirect_light.dart';
export 'src/models/scene/indirect_light/indirect_light.dart';
export 'src/models/scene/indirect_light/ktx_indirect_light.dart';
export 'src/models/scene/light/light.dart';
export 'src/models/scene/light/light_type.dart';
export 'src/models/scene/material/material.dart';
export 'src/models/scene/material/material_parameter.dart';
export 'src/models/scene/material/material_type.dart';
export 'src/models/scene/material/texture/texture.dart';
export 'src/models/scene/material/texture/texture_sampler.dart';
export 'src/models/scene/material/texture/enums/mag_filter.dart';
export 'src/models/scene/material/texture/enums/min_filter.dart';
export 'src/models/scene/material/texture/enums/texture_type.dart';
export 'src/models/scene/material/texture/enums/wrap_mode.dart';
export 'src/models/scene/skybox/colored_skybox.dart';
export 'src/models/scene/skybox/hdr_skybox.dart';
export 'src/models/scene/skybox/ktx_skybox.dart';
export 'src/models/scene/skybox/skybox.dart';
export 'src/models/scene/ground.dart';
export 'src/models/scene/scene.dart';
export 'src/models/shapes/cube.dart';
export 'src/models/shapes/plane.dart';
export 'src/models/shapes/shape.dart';
export 'src/models/shapes/sphere.dart';
export 'src/models/state/model_state.dart';
export 'src/models/state/scene_state.dart';
export 'src/models/state/shape_state.dart';




Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import 'package:flutter/services.dart';
import 'package:playx_3d_scene/models/scene/camera/camera.dart';
import 'package:playx_3d_scene/models/scene/camera/exposure.dart';
import 'package:playx_3d_scene/models/scene/camera/lens_projection.dart';
import 'package:playx_3d_scene/models/scene/camera/projection.dart';
import 'package:playx_3d_scene/models/scene/geometry/position.dart';
import 'package:playx_3d_scene/models/scene/ground.dart';
import 'package:playx_3d_scene/models/scene/indirect_light/default_indirect_light.dart';
import 'package:playx_3d_scene/models/scene/light/light.dart';
import 'package:playx_3d_scene/models/scene/material/material.dart';
import 'package:playx_3d_scene/models/shapes/shape.dart';
import 'package:playx_3d_scene/models/state/model_state.dart';
import 'package:playx_3d_scene/utils/result.dart';
import 'package:playx_3d_scene/utils/utils.dart';
import 'package:playx_3d_scene/src/models/scene/camera/camera.dart';
import 'package:playx_3d_scene/src/models/scene/camera/exposure.dart';
import 'package:playx_3d_scene/src/models/scene/camera/lens_projection.dart';
import 'package:playx_3d_scene/src/models/scene/camera/projection.dart';
import 'package:playx_3d_scene/src/models/scene/geometry/position.dart';
import 'package:playx_3d_scene/src/models/scene/ground.dart';
import 'package:playx_3d_scene/src/models/scene/indirect_light/default_indirect_light.dart';
import 'package:playx_3d_scene/src/models/scene/light/light.dart';
import 'package:playx_3d_scene/src/models/scene/material/material.dart';
import 'package:playx_3d_scene/src/models/shapes/shape.dart';
import 'package:playx_3d_scene/src/models/state/model_state.dart';
import 'package:playx_3d_scene/src/utils/result.dart';
import 'package:playx_3d_scene/src/utils/utils.dart';

///An object which helps facilitate communication between the [Playx3dScene] Widget
///and android side model viewer based on Filament.
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:playx_3d_scene/models/model/model.dart';
import 'package:playx_3d_scene/src/models/model/model.dart';

/// represents object of model that will be loaded from gltf file.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:playx_3d_scene/models/model/animation.dart';
import 'package:playx_3d_scene/models/model/glb_model.dart';
import 'package:playx_3d_scene/models/model/gltf_model.dart';
import 'package:playx_3d_scene/models/scene/geometry/position.dart';
import 'package:playx_3d_scene/src/models/model/animation.dart';
import 'package:playx_3d_scene/src/models/model/glb_model.dart';
import 'package:playx_3d_scene/src/models/model/gltf_model.dart';
import 'package:playx_3d_scene/src/models/scene/geometry/position.dart';

/// represents base object of the 3d model to be rendered.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'dart:core';

import 'package:playx_3d_scene/models/scene/camera/enums/camera_mode.dart';
import 'package:playx_3d_scene/models/scene/camera/enums/fov.dart';
import 'package:playx_3d_scene/models/scene/camera/exposure.dart';
import 'package:playx_3d_scene/models/scene/camera/projection.dart';
import 'package:playx_3d_scene/models/scene/geometry/position.dart';
import 'package:playx_3d_scene/src/models/scene/camera/enums/camera_mode.dart';
import 'package:playx_3d_scene/src/models/scene/camera/enums/fov.dart';
import 'package:playx_3d_scene/src/models/scene/camera/exposure.dart';
import 'package:playx_3d_scene/src/models/scene/camera/projection.dart';
import 'package:playx_3d_scene/src/models/scene/geometry/position.dart';

import 'lens_projection.dart';

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:core';

import 'package:playx_3d_scene/models/scene/camera/enums/fov.dart';
import 'package:playx_3d_scene/src/models/scene/camera/enums/fov.dart';

import 'enums/projection_type.dart';

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:playx_3d_scene/models/scene/geometry/size.dart';
import 'package:playx_3d_scene/models/shapes/plane.dart';
import 'package:playx_3d_scene/src/models/scene/geometry/size.dart';
import 'package:playx_3d_scene/src/models/shapes/plane.dart';

///An object that represents ground plane to be drawn on the scene.
class Ground extends Plane {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:playx_3d_scene/models/scene/indirect_light/indirect_light.dart';
import 'package:playx_3d_scene/src/models/scene/indirect_light/indirect_light.dart';

/// An object that represents indirect light based on given parameters like:
/// Irradiance
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:playx_3d_scene/models/scene/indirect_light/indirect_light.dart';
import 'package:playx_3d_scene/src/models/scene/indirect_light/indirect_light.dart';

/// An object that represents indirect light that is created from hdr file format.
class HdrIndirectLight extends IndirectLight {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:playx_3d_scene/models/scene/indirect_light/default_indirect_light.dart';
import 'package:playx_3d_scene/models/scene/indirect_light/hdr_indirect_light.dart';
import 'package:playx_3d_scene/models/scene/indirect_light/ktx_indirect_light.dart';
import 'package:playx_3d_scene/src/models/scene/indirect_light/default_indirect_light.dart';
import 'package:playx_3d_scene/src/models/scene/indirect_light/hdr_indirect_light.dart';
import 'package:playx_3d_scene/src/models/scene/indirect_light/ktx_indirect_light.dart';

/// An object that represents Indirect Light which is used to simulate environment lighting, a form of global illumination.
/// Filament supports rendering with image-based lighting, or IBL.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:playx_3d_scene/models/scene/indirect_light/indirect_light.dart';
import 'package:playx_3d_scene/src/models/scene/indirect_light/indirect_light.dart';

/// An object that represents indirect light that is created from ktx file format.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'dart:ui';

import 'package:playx_3d_scene/models/scene/geometry/direction.dart';
import 'package:playx_3d_scene/models/scene/geometry/position.dart';
import 'package:playx_3d_scene/models/scene/light/light_type.dart';
import 'package:playx_3d_scene/utils/utils.dart';
import 'package:playx_3d_scene/src/models/scene/geometry/direction.dart';
import 'package:playx_3d_scene/src/models/scene/geometry/position.dart';
import 'package:playx_3d_scene/src/models/scene/light/light_type.dart';
import 'package:playx_3d_scene/src/utils/utils.dart';

/// An object that allows you to create a light source in the scene, such as a sun or street lights.
/// Light types - Lights come in three flavors:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:playx_3d_scene/models/scene/material/material_paramater.dart';
import 'package:playx_3d_scene/src/models/scene/material/material_parameter.dart';

/// An object that defines the visual appearance of a surface.
/// Filament offers a customizable material system
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'dart:ui';

import 'package:playx_3d_scene/models/scene/material/material_type.dart';
import 'package:playx_3d_scene/models/scene/material/texture/texture.dart';
import 'package:playx_3d_scene/utils/utils.dart';
import 'package:playx_3d_scene/src/models/scene/material/material_type.dart';
import 'package:playx_3d_scene/src/models/scene/material/texture/texture.dart';
import 'package:playx_3d_scene/src/utils/utils.dart';

/// An object that represents material parameters that are defined in the .mat file.
class MaterialParameter {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:playx_3d_scene/models/scene/material/texture/texture_sampler.dart';
import 'package:playx_3d_scene/src/models/scene/material/texture/texture_sampler.dart';

///Magnification filter to be used.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:playx_3d_scene/models/scene/material/texture/enums/texture_type.dart';
import 'package:playx_3d_scene/models/scene/material/texture/texture_sampler.dart';
import 'package:playx_3d_scene/src/models/scene/material/texture/enums/texture_type.dart';
import 'package:playx_3d_scene/src/models/scene/material/texture/texture_sampler.dart';

/// An object represents textures to be loaded by the material.
class PlayxTexture {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:playx_3d_scene/models/scene/material/texture/enums/mag_filter.dart';
import 'package:playx_3d_scene/models/scene/material/texture/enums/min_filter.dart';
import 'package:playx_3d_scene/models/scene/material/texture/enums/wrap_mode.dart';
import 'package:playx_3d_scene/src/models/scene/material/texture/enums/mag_filter.dart';
import 'package:playx_3d_scene/src/models/scene/material/texture/enums/min_filter.dart';
import 'package:playx_3d_scene/src/models/scene/material/texture/enums/wrap_mode.dart';

/// An object that defines how a texture is accessed.
class PlayxTextureSampler {
Expand Down
10 changes: 5 additions & 5 deletions lib/models/scene/scene.dart → lib/src/models/scene/scene.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:playx_3d_scene/models/scene/camera/camera.dart';
import 'package:playx_3d_scene/models/scene/ground.dart';
import 'package:playx_3d_scene/models/scene/indirect_light/indirect_light.dart';
import 'package:playx_3d_scene/models/scene/light/light.dart';
import 'package:playx_3d_scene/models/scene/skybox/skybox.dart';
import 'package:playx_3d_scene/src/models/scene/camera/camera.dart';
import 'package:playx_3d_scene/src/models/scene/ground.dart';
import 'package:playx_3d_scene/src/models/scene/indirect_light/indirect_light.dart';
import 'package:playx_3d_scene/src/models/scene/light/light.dart';
import 'package:playx_3d_scene/src/models/scene/skybox/skybox.dart';

/// An object that represents the scene to be rendered with information about light, skybox and more.
class Scene {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:playx_3d_scene/models/scene/skybox/skybox.dart';
import 'package:playx_3d_scene/utils/utils.dart';
import 'package:playx_3d_scene/src/models/scene/skybox/skybox.dart';
import 'package:playx_3d_scene/src/utils/utils.dart';

/// An object that represents skybox based that shows a color only.
class ColoredSkybox extends Skybox {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:playx_3d_scene/models/scene/skybox/skybox.dart';
import 'package:playx_3d_scene/src/models/scene/skybox/skybox.dart';

/// An object that represents skybox that will be loaded from hdr file.
class HdrSkybox extends Skybox {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:playx_3d_scene/models/scene/skybox/skybox.dart';
import 'package:playx_3d_scene/src/models/scene/skybox/skybox.dart';

/// An object that represents skybox that will be loaded from ktx file.
/// Filament supports rendering with image-based lighting, or IBL.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'dart:ui';

import 'package:playx_3d_scene/models/scene/skybox/colored_skybox.dart';
import 'package:playx_3d_scene/models/scene/skybox/hdr_skybox.dart';
import 'package:playx_3d_scene/models/scene/skybox/ktx_skybox.dart';
import 'package:playx_3d_scene/utils/utils.dart';
import 'package:playx_3d_scene/src/models/scene/skybox/colored_skybox.dart';
import 'package:playx_3d_scene/src/models/scene/skybox/hdr_skybox.dart';
import 'package:playx_3d_scene/src/models/scene/skybox/ktx_skybox.dart';
import 'package:playx_3d_scene/src/utils/utils.dart';

/// An object that represents the skybox to be rendered in the scene.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:playx_3d_scene/models/scene/geometry/size.dart';
import 'package:playx_3d_scene/models/shapes/shape.dart';
import 'package:playx_3d_scene/src/models/scene/geometry/size.dart';
import 'package:playx_3d_scene/src/models/shapes/shape.dart';

/// An object that represents a cube shape to be rendered.
class Cube extends Shape {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:playx_3d_scene/models/scene/geometry/size.dart';
import 'package:playx_3d_scene/models/shapes/shape.dart';
import 'package:playx_3d_scene/src/models/scene/geometry/size.dart';
import 'package:playx_3d_scene/src/models/shapes/shape.dart';

/// An object that represents a plane shape to be rendered.
class Plane extends Shape {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:playx_3d_scene/models/scene/geometry/direction.dart';
import 'package:playx_3d_scene/models/scene/geometry/position.dart';
import 'package:playx_3d_scene/models/scene/material/material.dart';
import 'package:playx_3d_scene/models/shapes/cube.dart';
import 'package:playx_3d_scene/models/shapes/plane.dart';
import 'package:playx_3d_scene/models/shapes/sphere.dart';
import 'package:playx_3d_scene/src/models/scene/geometry/direction.dart';
import 'package:playx_3d_scene/src/models/scene/geometry/position.dart';
import 'package:playx_3d_scene/src/models/scene/material/material.dart';
import 'package:playx_3d_scene/src/models/shapes/cube.dart';
import 'package:playx_3d_scene/src/models/shapes/plane.dart';
import 'package:playx_3d_scene/src/models/shapes/sphere.dart';

/// An object that represents shapes to be rendered on the scene.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:playx_3d_scene/models/shapes/shape.dart';
import 'package:playx_3d_scene/src/models/shapes/shape.dart';

/// An object that represents a cube shape to be rendered.
class Sphere extends Shape {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 15 additions & 15 deletions lib/view/playx_3d_scene.dart → lib/src/view/playx_3d_scene.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/services.dart';
import 'package:playx_3d_scene/controller/playx_3d_scene_controller.dart';
import 'package:playx_3d_scene/models/model/model.dart';
import 'package:playx_3d_scene/models/scene/camera/camera.dart';
import 'package:playx_3d_scene/models/scene/ground.dart';
import 'package:playx_3d_scene/models/scene/indirect_light/indirect_light.dart';
import 'package:playx_3d_scene/models/scene/light/light.dart';
import 'package:playx_3d_scene/models/scene/scene.dart';
import 'package:playx_3d_scene/models/scene/skybox/skybox.dart';
import 'package:playx_3d_scene/models/shapes/cube.dart';
import 'package:playx_3d_scene/models/shapes/plane.dart';
import 'package:playx_3d_scene/models/shapes/shape.dart';
import 'package:playx_3d_scene/models/shapes/sphere.dart';
import 'package:playx_3d_scene/models/state/model_state.dart';
import 'package:playx_3d_scene/models/state/scene_state.dart';
import 'package:playx_3d_scene/models/state/shape_state.dart';
import 'package:playx_3d_scene/src/controller/playx_3d_scene_controller.dart';
import 'package:playx_3d_scene/src/models/model/model.dart';
import 'package:playx_3d_scene/src/models/scene/camera/camera.dart';
import 'package:playx_3d_scene/src/models/scene/ground.dart';
import 'package:playx_3d_scene/src/models/scene/indirect_light/indirect_light.dart';
import 'package:playx_3d_scene/src/models/scene/light/light.dart';
import 'package:playx_3d_scene/src/models/scene/scene.dart';
import 'package:playx_3d_scene/src/models/scene/skybox/skybox.dart';
import 'package:playx_3d_scene/src/models/shapes/cube.dart';
import 'package:playx_3d_scene/src/models/shapes/plane.dart';
import 'package:playx_3d_scene/src/models/shapes/shape.dart';
import 'package:playx_3d_scene/src/models/shapes/sphere.dart';
import 'package:playx_3d_scene/src/models/state/model_state.dart';
import 'package:playx_3d_scene/src/models/state/scene_state.dart';
import 'package:playx_3d_scene/src/models/state/shape_state.dart';

typedef Playx3dSceneCreatedCallback = void Function(
Playx3dSceneController controller);
Expand Down
Loading

0 comments on commit d75f186

Please sign in to comment.